日期:2014-05-16 浏览次数:20398 次
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtmll/DTD/xhtmll-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>form表单</title> <script type="text/javascript"> function window_onload() { var numberForms=document.forms.length; var formIndex; for(formIndex=0;formIndex<numberForms;formIndex++) { alert(document.forms[formIndex].name; } } </script> </head> <body onload="window_onload()"> <form action=" " name="form1"> <p> this is inside form1 </p> </form> <form action=" " name="form2"> <p> this is inside form2 </p> </form> <form action=" " name="form3"> <p> this is inside form3 </p> </form> </body> </html>