Ticket #4582 (closed enhancement: duplicate)
Cross-browser jQuery(html) behaviour
|Reported by:||borg42||Owned by:|
|Keywords:||html area map||Cc:|
The following should do the same and should work for all tags* in major browsers:
$('<area/>').attr('class', 'myArea'); $('<area class="myArea");
As of v1.3.2, the above commands don't always work in a cross-browser way. (Firefox is pickier than IE here.)
*: it'd be also great if it'd support tags that can appear inside the html body.
Idea: for performance reasons, what about the following implementation: always running the usual div-.innerHTML, detecting failure (.length=0 / tag name /..), and if so, split the string and create the tag with createElement, then apply the attributes? This would only slow down specific tags, and only for browsers that can't create the elements with div-.innerHTML. Furthermore, it wouldn't slow down previously supported tag creations, only new ones.