The following jQuery works fine in Firefox for me, but failed in IE6:
$("<map></map>").attr("name",somevar).appendTo("#someElement");
The problem is that the map element never gets the name attribute generated which I can prove by calling alert($("#someElement").html()); and the fact that the image it is associated with doesn't have its links
If I use this instead, it works fine:
$("<map name='" + somevar + "'></map>").appendTo("#someElement");
I'm happy to use the second line of code, but was wondering if anyone else has had this problem...or an explanation of why it didn't work (i'm wondering that it is specific to the name attribute)...
(HTML output from first and second scenario):
IE6 using the first line:
<MAP><AREA shape=RECT coords=0,0,300,110 href="http://google.com"></MAP><IMG height=215 src="include/nav-images/main.png" width=591 useMap=#tehmap>
IE6 using the second line:
<MAP name=tehmap><AREA shape=RECT coords=0,0,300,110 href="http://google.com"></MAP><IMG height=215 src="include/nav-images/main.png" width=591 useMap=#tehmap>