Solucionado (ver solución)
Solucionado
(ver solución)
2
respuestas

[Proyecto] Juego secreto!

<meta charset="UTF-8">
<hr><big><h1>HALLEMOS EL NÚMERO</h1><
/big>
<input/>
<br>
<br>
<button>Comprobar</button>
<script>
function mostrar(){
var numeroAleatorio = Math.round(Math.random()*10);
var input = document.querySelector("input");
input.focus();
if((parseInt(input.value)) == numeroAleatorio){
alert("Número correcto");
}else{
alert("Número ingresado incorrecto, el numero correcto es "+numeroAleatorio);
}
var button = document.querySelector("button");
button.onclick = mostrar;
</script>

Ingrese aquí la descripción de esta imagen para ayudar con la accesibilidad

2 respuestas
solución!

a simple vista, bien. solo agregaría usar la indentación para hacerlo mas legible.

Concuerdo con el anterior compañero