Replace the text in each text field below with the correct JavaScript object, property, method, function name or comment. Click the test your code! button and see your JavaScript code in action.

 
<html>
<head>

<script language = "JavaScript">

    buttonoff = new 1 (200,200);
    buttonon = new Image(200,200);
    buttonoff.src="buttonoff.gif";
    buttonon.src="buttonon.gif";

    function imageOff (the_image) {

      2 =eval(the_image + "off.src");
    }
    function imageOn (the_image) {
      document[the_image].src=eval(3 );
    }
</script>

<title>JavaScript alert box example</title>

</head>
<body bgcolor = "FFFFFF">

    <a href="yourlink.html" 4 =
    "imageOn('
    5 ');return true;"
    onMouseOut="imageOff('6 ');return true;">
    <img src = "buttonoff.gif" height="31" width="82" border="0" name = "7 "></a>

</body>
</html>

 

Ask questions & get answers at the JavaScript forum >>

Back to example index

©2000 Joe Sriver, www.sriver.com