Guest User

Untitled

a guest
Nov 20th, 2014
162
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html>
  3. <head lang="en">
  4. <meta charset="UTF-8">
  5. <title>DIV's Content</title>
  6. </head>
  7. <body>
  8. <div>first div</div>
  9. <div>second div</div>
  10. <div class="empty"></div>
  11. <div>third div<div>inner div</div></div>
  12. <ul id="result"></ul>
  13. <script>
  14. var inputs = document.getElementsByTagName('div');
  15. var list = document.getElementById('result');
  16. for(var i = 0; i<inputs.length; i++){
  17.  
  18. var liElement = document.createElement('li');
  19. liElement.innerHTML = inputs[i].innerHTML;
  20. list.appendChild(liElement);
  21. }
  22. </script>
  23.  
  24. </body>
  25. </html>
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×