Skip to main content

Bug Tracker

Side navigation

#4582 closed enhancement (duplicate)

Opened April 23, 2009 12:12PM UTC

Closed November 17, 2010 02:46AM UTC

Last modified March 15, 2012 02:35PM UTC

Cross-browser jQuery(html) behaviour

Reported by: borg42 Owned by:
Priority: major Milestone:
Component: core Version: 1.3.2
Keywords: html area map Cc:
Blocked by: Blocking:

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.

Attachments (0)
Change History (3)

Changed April 24, 2009 03:07AM UTC by dmethvin comment:1

This is related to #4559 and #4484.

Changed November 17, 2010 02:46AM UTC by dmethvin comment:2

resolution: → duplicate
status: newclosed

Changed November 17, 2010 02:46AM UTC by dmethvin comment:3

Duplicate of #4484.