解决方案 »

  1.   

    function cc(val){
                if(/^[0-9]*$/.test(val)){
                    if( val < 5 ){
                        alert("请输入大于5的数字");
    document.getElementById("asd").value = 7;
                    }
                }else{
                    alert("请输入数字!");
                }
            }