This is a discussion on How to get all the links on a HTML page with javascript? within the HTML, CSS and Javascript Coding Techniques forums, part of the Web Development category; Hi All, I have a requirement with html links, i want to get all the links using a javascript function, ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#1
| |||
| |||
| Hi All, I have a requirement with html links, i want to get all the links using a javascript function, after i get the links i have to change the styles for the links if the links ids were started with "SpecialLinks" Any help will be appreciated..... thnx..... |
|
#2
| |||
| |||
| hey deeban, Try the following script by putting it on page where there are at least one hyperlink (for example <a href="http://Example.com">Example</a> ) <script> for (i=0; i < document.links.length; i++) { alert(document.links[i].href); } </script>
__________________ Venkat knowledge is Power |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to change aspx page to html page? | S.Vinothkumar | ASP and ASP.NET Programming | 4 | 10-26-2007 11:46 PM |
| How can I disable links and buttons till the page is loaded? | kingmaker | HTML, CSS and Javascript Coding Techniques | 1 | 10-15-2007 03:13 AM |
| HTML links | tripnautic | HTML, CSS and Javascript Coding Techniques | 6 | 04-05-2007 01:34 PM |
| Google's updating of page rank, back links | oyu2o | 0 | 03-11-2007 06:12 AM | |
| Javascript Tutorials, Links and Resources. | spid4r | HTML, CSS and Javascript Coding Techniques | 0 | 03-08-2007 11:06 PM |
Our Partners |