I have done everything correct but still, for all values the function is display "Invalid" only. Can someone tell me where is the problem ?
<html>
<head>
<script>
function alpha()
{
var x = document.getElementById('input1');
var y = x.value;
var z = isNaN(y);
if(z<1 || z>10){console.log("Invalid");} else {console.log("valid");}
}
</script>
</head>
<body>
<button id="but1" onmouseover="alpha()" style="background:blue;">Click Me</button>
<p id=para1> Hello! This is paragraph One! </p>
<input type=text id=input1 >
</body>
</html>
Thanks in advance, and sorry for asking silly question! But, I cant find where code is getting wrong!
isNaNis not a number but a boolean.