Fork me on GitHub

onblur判断数字

window.onload = function () {
            document.getElementById('text1').onblur = function () {
                if (isNaN(document.getElementById('text1').value)) { 验证输入的字符是否为数字
                    alert(请检查输入的值是否正确);
                    document.getElementById('text1').value = ;
                }
            }
        }
posted @ 2014-04-21 13:33  乔闻  阅读(266)  评论(0编辑  收藏  举报