Bug Tracker

Ticket #11194 (closed bug: invalid)

Opened 3 years ago

Last modified 3 years ago

Passing a HTML tag with attributes to jQuery without a closing tag (either /> or </tag>) has different behaviour in IE 8

Reported by: oheard Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.7.1
Keywords: Cc:
Blocking: Blocked by:

Description

When creating a new HTML element with attributes by passing the source to the jQuery constructor, if no closing tag is present most browsers create the element anyway.

IE 8 (and maybe below, I don't have < 8) return an empty jQuery object.

Example without attributes, showing the expected behavour:  http://jsfiddle.net/HJyGz/0/

Example with an attribute, showing the buggy behaviour:  http://jsfiddle.net/HJyGz/1/

Change History

comment:1 Changed 3 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to invalid

Yes, as clearly documented. If it needs a closing tag you should provide one. Just like script tags need a closing tag and can't be shortcutted.

 http://api.jquery.com/jQuery/#jQuery2

Note: See TracTickets for help on using tickets.