isNaN()对"" 和" " 会返回false

刚刚接触前端开发,今天在使用 isNaN()验证的时候遇到一些小彩弹:前端 <input id="phone" type="text" placeholder="13000000000"> 一个电话号码的验证:web if (isNaN(value)) { alert("Sorry, phone number is wrong!"); } else{ alert("
相关文章
相关标签/搜索