Comparto mi código al cual le aumente mensajes de mayor y menor
<meta charset="UTF-8">
<input/>
<button> Verificar si acerto con el secreto</button>
<script>
var secreto = Math.round(Math.random()*10);
var input = document.querySelector("input");
input.focus();
function verificar() {
if(parseInt(input.value)== secreto){
alert ("Usted acerto");
}
if (parseInt(input.value)> secreto){
alert ("El numero es menor");
}
if(parseInt(input.value)< secreto){
alert ("El numero es mayor");
}
input.value="";
input.focus();
}
var button = document.querySelector("button");
button.onclick = verificar;
</script>