<!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>
侃侃尔雅
相关分类