I wanted to write a Greasemonkey script to modify all mailto: links on a page, but to do that, I have to find them first.
Here’s my first attempt:
It’s pretty bad. I wanted to find links starting with “mailto:” but couldn’t figure out how to operate on the href attribute.
Here you can see that I managed to operate on the href attribute, and then back back up to the a node. I learned how to select the attribute, instead of using the attribute to select the node.
Simplified even further!
I knew there was a starts with function… I just had to look it up.