Results 1 to 2 of 2

Thread: <area onclick help

  1. #1
    Join Date
    Jan 2006

    <area onclick help

    Hello, I have a bit of a problem trying to work something out. I have an image with a map on it, what i'm trying to achieve is a div appears exactly where someone clicks the map.

    <area name="whatever" onClick="javascript:document.all.whatever.class.display='block'">
    <div id="whatever" style="display:none;">
    I'm using something similar to the above, but nothing happens on the click.

  2. #2
    Join Date
    Mar 2005
    Try this (not tested it myself), it should at least fix your javascript.
    <script type="text/javascript">
    function area1Clicked () {
        var div1 = document.getElementById("div1"); = "block";
    <area name="area1" onClick="area1Clicked()">
    <div id="div1" style="display:none;">
    But I think you should read this
    The area tag must always be nested within a map tag and you must also provide an alt attribute. Also, I'm not sure what happens if you don't specify the coords attribute.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts