标签:
html============= user:<input id=‘user‘ type="text"> password:<input id=‘password‘ type="text"> <input id=‘button‘ type="button" value="check"> js=============== var user=document.getElementById(‘user‘); var password=document.getElementById(‘password‘); var button=document.getElementById(‘button‘); button.onclick=function () { if(user.value.length<=0){ alert(‘no user‘); }else if(password.value.length<=0){ alert(‘no password‘); }else{ alert(‘ok‘); } }
标签:
原文地址:http://www.cnblogs.com/wz0107/p/4589749.html