Skip to main content

Bug Tracker

Side navigation

#11620 closed bug (wontfix)

Opened April 23, 2012 12:41PM UTC

Closed April 23, 2012 02:19PM UTC

Last modified April 23, 2012 05:19PM UTC

Creating custom element with inline attributes broken in IE

Reported by: c0d3rg1rl Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.7.2
Keywords: Cc:
Blocked by: Blocking:
Description

$('<content456 />').attr('id', 'content456') works.

$('<content789 id="content789" />') fails.

Testcase "fail": http://jsfiddle.net/fuNth/

If "old school" document.createElement('content789') is used, it works with IE:

Testcase "old school": http://jsfiddle.net/fuNth/1/

Discussion in IRC-channel pointed to a possible bug in createDocumentFragment or similar.

Attachments (0)
Change History (3)

Changed April 23, 2012 02:19PM UTC by rwaldron comment:1

resolution: → wontfix
status: newclosed

Creating "custom" elements in old IE is broken, which is why newer HTML5 elements must be specially created via shims. jQuery does some internal work to make it easy for manipulating HTML5 elements, but does not provide a mechanism for creating arbitrary elements in archiac browsers.

Changed April 23, 2012 04:31PM UTC by c0d3rg1rl comment:2

Additional info for interested readers:

The above "fail" testcase does not work with IE7 and IE8 on Windows XP.

It does work with IE9 on Windows 7.

Changed April 23, 2012 05:19PM UTC by dmethvin comment:3

Right, once the world gets to HTML5 there are very specific rules about how the document should be parsed in the face of unknown tags or syntax errors. Even so, it is not a good idea to make up your own tags outside of an XML document.