Bug Tracker

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#11620 closed bug (wontfix)

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:


$('<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.

Change History (3)

comment:1 Changed 11 years ago by Rick Waldron

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.

comment:2 Changed 11 years ago by c0d3rg1rl

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.

comment:3 Changed 11 years ago by dmethvin

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.

Note: See TracTickets for help on using tickets.