codigo
<meta charset="UTF-8">
<input/>
<button>Verificar</button>
<script>
var secreto = Math.round(Math.random()*10);
var input= document.querySelector("input")
input.focus();
function verificar() {
if (parseInt(input.value) == secreto){
alert("Acerto")
}
else{
alert("Incorrecto")
}
input.value = ""
input.focus();
}
var button = document.querySelector("button")
button.onclick = verificar
</script>