0
I’m playing a Jokenpo game, and I need a username to put on the Score. In this case I created a home page with a textfield for the user to enter his name. Just after you have entered your name, you should open the other page where the game is with the options.
<div class="container">
<input type="text" id="nameJogador" placeholder="Nome do Jogador">
</div>
$(document).ready(function(){
$("#nameJogador").focusout(function(){
var nomeJogador = $("#nameJogador").val();
//$("input#nameJogador").load('index_game');
alert(nomeJogador);
});
});
What exactly are you failing to do?
– Rafael Augusto
Type I did the event, only I wanted after it loses focus, the variable nameJewer took the value of Txfield, opened the other page where the game is itself and the JS script took this value from that first page to make comparisons.
– Vinicius1402
I put an answer, see if that’s what you want.
– Rafael Augusto