I have an image map, with several areas defined. What I'm trying to do is get a value added to an array each time someone clicks on a specific area, and have the array displayed in real-time on the screen.
In my head section I have the array (not sure if this is correct):
<script type="text/javascript">
var numArray = [];
</script>
Then I have somewhere in the body of the page
<p class="txt"><script type="text/javascript">document.write(numArray);</script></p>
The <map> areas are something like this:
<area shape="circle" coords="129,325,72" alt="1" href="javascript:numArray.push('1')">
<area shape="circle" coords="319,325,72" alt="2" href="javascript:numArray.push('2')">
<area shape="circle" coords="510,325,72" alt="3" href="javascript:numArray.push('3')">
So for example, if someone clicks on 1, then 2, then 3, I would like the array to display 123 in the <p>.
When I use this though, it doesn't add anything to the array (or at least the values aren't displaying).