<!DOCTYPE html><html><head> <title></title> <script type="text/javascript"> window.onload=function(){ var oIpt1=document.getElementById('ipt1'); var oBtn1=document.getElementById('btn1'); oBtn1.onclick=function(){ var oValue=oIpt1.oValue; if(oValue.length>10){ return false; }else{ return true; } } } </script></head><body><form> <input type="text" id="ipt1"> <button type="submit" id="btn1">提交</button></form></body></html>
這個長度大于10的時候為什么還能提交成功呢?
翻過高山走不出你
2018-08-11 10:09:58