PDA

View Full Version : How to onclick on a hyperlink ?


Richard2003
02-16-2004, 11:01 PM
Hi !

I have a working code that sets a cookie and execute the full() function, when the user clicks on an image.

How can I obtain the same onclick= effect when clicking on a hyperlink that is simple text?

document.write('<img src="'+b+'" vspace="5" hspace="5" border="1" alt="" onclick="setCookie(\'imgnum\',getImageNum(this)); full(\'showpic.htm\');"/>');


Thanks in advance!
Richard

glenngv
02-17-2004, 04:58 AM
document.write('<a href="showpic.htm" onclick="setCookie(\'imgnum\',getImageNum(this)); full(\'showpic.htm\');return false">Show Picture</a>');