Click to See Complete Forum and Search --> : simple prob


PeterKay1
03-05-2003, 07:42 AM
hey, ive just started using javascript. How do i call a function when an image or link is clicked?

thanx in advance

pyro
03-05-2003, 07:50 AM
For an image...

<img src="your.gif" onClick="yourfunction();">

And a link is quite similar

<a href="#" onClick="yourfunction(); return false;">Run yourfunction()</a>