[Greasemonkey] Changing Links without IDs

Vectorspace vectorspace at ntlworld.com
Mon Mar 20 11:51:13 EST 2006


use links=document.getElementsByTagName("a") to get an array of all 
links in the page
use for(i=0;i<links.length;i++) to cycle through all links

links[i].innerHTML is the text of the current link - use indexOf() to 
search it for a specific block of test
When you find it make your changes and use break to exit the for loop

matturn wrote:
> I'm a noob. How might I change a link that has no ID? It's main identifying
> feature is the text of the URL.
> --
> View this message in context: http://www.nabble.com/Changing-Links-without-IDs-t1310523.html#a3491665
> Sent from the MozDev - greasemonkey forum at Nabble.com.
>
> _______________________________________________
> Greasemonkey mailing list
> Greasemonkey at mozdev.org
> http://mozdev.org/mailman/listinfo/greasemonkey
>
>   


More information about the Greasemonkey mailing list