word OK มาจากฟ้า
✨ elzaphaN TV
<html> <head> <title>Let's Start </title> <style> .background { position: absolute; background-color: red; height: 100vh; width: 500px; top: 50%; left: 50%; transform: translate(-50%,-50%); } .platform { height: 50px; width: 100%; background-color: black; margin-top: 380px; } .t_rex { position: absolute; height: 30px; width: 25px; left: 50%; margin-top: 350px; background-color: white; } .box_input{ margin: auto; margin-top: 25px; height: 40px; width: 300px; } .box_input input{ height: 100%; width: 100%; } </style> </head> <body> <div class="background"> <div class="t_rex"> </div> <div class="platform"> </div> <div class="box_input"> <input id="input_word"> </div> </div> <script> var input = input_word input.addEventListener("keyup", function(event) { if (event.keyCode === 13) { alert(input.value) } }); </script> </body> </html>