编辑下面的代码:【加编码】
<html> <head> <script> function getElements()   {   var x=document.getElementsByTagName("input");   alert(x.length);   } </script> </head> <body> <input type="text" size="20"><br> <input type="text" size="20"><br> <input type="text" size="20"><br><br> <input type="button" onclick="getElements()" value="How many input elements?"> </body> </html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂