Forum Moderators: open
external JS file contains a function
function addButton(a){
var btnScr = document.createElement("img");
btnScr.setAttribute('class', 'curr');
btnScr.setAttribute('src', 'images/a.gif');
btnScr.setAttribute('alt', 'change currency');
btnScr.setAttribute('usemap','#rr');
if (a==1){
document.getElementById("oDiv1").appendChild(btnScr);}
}
another External JS File contains another function
function Alerton_click(x){alert(x);}
the page itself contains image map code:
<map name="rr" id="rr">
<area shape="rect" coords="1,4,27,12" onclick="Alerton_click('Hi');" />
<area shape="rect" coords="30,4,60,15" onclick="Alerton_click('Hey');" />
</map>
the image gets displayd on the page at the position it needs to be, but image map functionality woun't work.
Am I missing something?
Thanks in advance.