js Form.elements[i]的使用实例
代码如下: //检查表单元素是否为空 function check(Form) { for (i=0;i<Form.length;i++){ if(Form.elements[i].value == “”) { //Form的属性elements的首字e要小写 alert(Form.elements[i].name + “不能为空!”); Form.elements[i].focus(); //指定表单元素获得焦点 return; } } Form.submit(); } 调用 <form name=”form1′′ method=”post” action=””&g
下载地址
用户评论