JS get the value of tag

From , 5 Years ago, written in JavaScript, viewed 133 times.
URL https://pastebin.vip/view/fdda6e95
  1. <script type="text/javascript">  
  2.         window.onload=function(){  
  3.             var items=document.getElementsByTagName("p");  
  4.             for(var i=0;i<items.length;i++){  
  5.                 var value=items[i].firstChild.nodeValue;  
  6.                 alert(value);  
  7.             }  
  8.         }  
  9.     </script>  
  10. </head>  
  11. <body>  
  12. <p>测试1</p>  
  13. <p>测试2</p>
  14. //javascript/794

Reply to "JS get the value of tag

"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website