【JavaScript】for循环得出多个span的值

来源:互联网 发布:淘宝店铺怎样上传图片 编辑:程序博客网 时间:2024/06/08 04:33
http://topic.csdn.net/t/20060826/20/4977972.html<body>     <form   id="Form1"   action="">     <span   id   ="sp1">Label1</span><br>     <span   id   ="sp2">Label2</span><br>     <span   id   ="sp3">Label3</span><br>     <span   id   ="sp4">Label4</span><br>     <span   id   ="sp5">Label5</span><br>     </form>     <script>     spans   =   document.getElementById("Form1").getElementsByTagName("SPAN")     for(i=0;i<spans.length;i++)     alert(spans[i].innerHTML)     </script>     </body>


原创粉丝点击