simple - images and javascript

Discussion in 'JavaScript' started by silverz, May 9, 2008.

  1. #1
    Hello. This is, i believe, a really simple question(i'm a newbie).

    I'm trying to display an image which, when clicked, would execute a javascript command(in this case, a showOverlay script).

    I know how to do this with a simple hyperlink :

    <a href="javascript: showOverlay();"> Example</a>

    but instead of the word 'Example' i would like to have a clickable image. What is the code to do that ?
     
    silverz, May 9, 2008 IP
  2. apmsolutions

    apmsolutions Peon

    Messages:
    66
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    So instead of Example you would have:

    <img src="location of image">
     
    apmsolutions, May 9, 2008 IP