<meta charset="UTF-8">
<input/>
<button><h1><B>TENTE A SORTE!</B></h1></button>
<script>
var segredo = Math.round(Math.random() * 10);
var input = document.querySelector("input");
input.focus ();
function verifica (){
if (input.value == segredo){
alert("ACERTO MIZERAVIII!!!");
}else{
alert ("ERROUUUUUU!")
}
input.value = "";
input.focus ();
}
var button = document.querySelector("button");
button.onclick = verifica;
</script>