This conditional has a semicolon after the ( ) of the if statement. That is a null statement. so,
If the number is 9
do nothing
do the alert()
Note that indentation does not tell JS what to do. It lets people read it easily. (Or not in this case.)
<script> function checkValue(){ var val = document.getElementById("num").value; if (val == 9) ; alert("the number entered is 9"); } </script>