Home >Web Front-end >JS Tutorial >Sharing of usage examples of isNAN()
nbsp;html> <meta> <title>Title</title> <script> function myfunction() { var t=document.getElementById("demo2").value; if(t==""||isNaN(t)){ alert("不是数字"); } else return; } </script> <h1>我的第一个 JavaScript 程序</h1> <p>请输入数字。如果输入值不是数字,浏览器会弹出提示框。</p> <input> <button>click</button>
The above is the detailed content of Sharing of usage examples of isNAN(). For more information, please follow other related articles on the PHP Chinese website!