Bug Tracker

Opened 7 years ago

Closed 7 years ago

#12812 closed bug (notabug)

$().add(html) returns different result on IE compared to Firefox/Chrome

Reported by: zouhenry@… Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.8.2
Keywords: Cc:
Blocked by: Blocking:

Description

$().add("<div><option> hello </option></div>").html()

IE (9): returns " hello "

Chrome/Firefox: returns "<option> hello </option>"

Change History (2)

comment:1 Changed 7 years ago by Christian Meixner <christian.meixner@…>

This is not valid HTML

<div><option> hello </option></div>

OPTION is not allowed in DIV!

Try:

$().add("<div><select><option> hello </option><select></div>").html();

and everything works fine (though still crappy code, you don't have to use .add() here)

comment:2 Changed 7 years ago by dmethvin

Resolution: notabug
Status: newclosed

Agreed, invalid HTML has undefined results.

Note: See TracTickets for help on using tickets.