<!DOCTYPE html>
<html>
<head>
<title></title>
<script type="text/javascript">
function ...
<!DOCTYPE html> <html> <head> <title></title> <script type="text/javascript"> function getElements(){ var x=document.getElementsByName("div"); for(var i=0;i<x.length; i++){ alert(x[i].innerHTML); } } </script> </head> <body> <div id="1">1231</div> <div id="2">qweq</div> <div id="3">qw12</div> <div id="4">as12</div> <div id="5">zx12</div> </body> </html>
阅读全文