Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

extract link from html text

Status
Not open for further replies.

newbiegalore

Programmer
Apr 12, 2008
8
US
Hello everyone,
I am new to JS and would appreciate any pointers about how to go about finding the html links on a html page.

I need to extrat the http link between the <a and </a tokens. Can someone please point me to a function that can do this.

Thanks
 
Hi there :) ,
Thanks for the reply. The problem is that I am writing an extension for firefox and am using the xmlhttprequest object to retreive the html code for a site. The reply is in text/html format and somehow using getelementbyTagName does not work on it. Even replyvariable.links does not dump the list of links on the page..

this is the complication.
 
Is there anything else you're not telling us that would have been helpful to know in your original post?

If not, simply set the innerHTML of a newly-created node to be your response HTML, and then you can use all of the regular DOM functions on that node.

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top