Posted By

scriptmakingcom on 03/16/08


Tagged

links extract documentlinks


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

Wiederkehr
melling


Extract links from a webpage


 / Published in: JavaScript
 

URL: http://www.webdeveloper.com/forum/showthread.php?t=65477

  1. function DoPrintLinks()
  2. {
  3.  
  4. var nCount = 0;
  5. var nEnd = document.links.length;
  6. var outpt="According to JavaScript, this document has "+nEnd+ " link(s) in it.<br>"
  7. for (nCount = 0 ; nCount < nEnd ; nCount ++){
  8. outpt+=document.links[nCount].href + "<br>"
  9. }
  10. document.write(outpt)
  11. }

Report this snippet  

You need to login to post a comment.