Bug Tracker

Opened 6 years ago

Closed 6 years ago

#13478 closed bug (notabug)

IE 8 element with attribute creation failure 1.8.3 and 1.9.1

Reported by: richard_collette@… Owned by:
Priority: undecided Milestone: None
Component: core Version: 1.9.1
Keywords: Cc:
Blocked by: Blocking:

Description

I am seeing a failure to create an element when the element is not self closed, has an attribute specified, and has no closing tag. It appears to work in a majority of the browsers except IE8. Have not tested it with IE7. Since the goal of jQuery is to have consistent behavior across browsers, I would expect this to either throw an error because the element HTML is not valid, or work consistently across browsers.

Fiddle is here, but you'll probably have to save it to a file to test in IE8 since jsfiddle doesn't seem to work any longer with IE8.

http://jsfiddle.net/ucdVC/2/

Change History (1)

comment:1 Changed 6 years ago by gibson042

Component: unfiledcore
Resolution: notabug
Status: newclosed

Closing tags are only optional for single elements without attributes.

http://api.jquery.com/jQuery/#creating-new-elements:

If the HTML is more complex than a single tag without attributes, as it is in the above example, the actual creation of the elements is handled by the browser's innerHTML mechanism.

To ensure cross-platform compatibility, the snippet must be well-formed. Tags that can contain other elements should be paired with a closing tag

Note: See TracTickets for help on using tickets.