<p id="demo"></p> <script> var y = 1000 / 0; document.getElementById("demo").innerHTML = isNaN(y); </script>