<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Juegosecreto</title>
</head>
<body>
    <h1>JUEGO SECRETO</h1>
    <input type="text">
    <button>Verificar si acerto con el secreto</button>
    <script>
        var secreto = Math.round(Math.random()*10);
        var input = document.querySelector("input");     
        function Verificar(){
            if(parseInt(input.value)==secreto){
                alert("Esta en lo correcto, acertaste.");
            }
            else{
                alert("Usted erro");
            }
            input.value="";
            input.focus();
        }
        var button = document.querySelector("button"); 
        button.onclick=Verificar;
    </script>
</body>
</html> 
            