Java Script of a clickable button image

Discussion in 'HTML & Website Design' started by mystery, Jun 27, 2007.

  1. #1
    Hi everyone,

    I have this java script for an image that is displayed and changes in appearance (like becoming brighter) when mouse is over it, and returns back to normal when mouse is out. The only problem is, I don't know how to add a url link so that when someone clicks on it, they go to the url address..

    Here is the code for the link... it is for a button that will take visitors back to the homepage:

    <td><a href="javascript:;" onMouseOver="MM_swapImage('btn_home','','images/btn_home_dn.gif',1)" onMouseOut="MM_swapImgRestore()"><img src="images/btn_home.gif" name="btn_home" width="183" height="26" border="0" id="btn_home"></a><br>
    <img src="images/pixi_clear.gif" width="1" height="3"></td>
     
    mystery, Jun 27, 2007 IP
  2. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,426
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #2
    Simply change "javascript:;" with your url. Example:
    
    ... <a href="[COLOR="Red"]http://www.google.com[/COLOR]" onMouseOver ...
    
    Code (markup):
     
    ajsa52, Jun 27, 2007 IP
  3. mystery

    mystery Banned

    Messages:
    744
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Ooops! Thanks, and excuse my ignorance!
     
    mystery, Jun 27, 2007 IP