how to determine a click on a link

Y

yusuf

Hi,

I am writing a greasemonkey script and I can capture the click event.
What I want to know is how do I determine that the click was on a URL
and not just a normal click. Thanks.

document.addEventListener('click', function(event) {
// event.target is the element that was clicked



alert(event.target.toString());

}, true);
 
Y

yusuf

i need this to work with every URL on the page, so it would be more
efficient if i didn't need to rewrite all the links... thanks.
 
H

Hal Rosser

ok - write a little program that adds the event handler (rewrites the page)
or for that matter, you could bring it into Word and do a simple
find/replace.
=== rewriting all the links is easier than rewriting half of them.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top