Skip to main content

Bug Tracker

Side navigation

#12812 closed bug (notabug)

Opened October 30, 2012 04:00PM UTC

Closed October 30, 2012 10:49PM UTC

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

Reported by: zouhenry@gmail.com 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>"

Attachments (0)
Change History (2)

Changed October 30, 2012 04:39PM UTC by Christian Meixner <christian.meixner@bippesbrandao.de> comment:1

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)

Changed October 30, 2012 10:49PM UTC by dmethvin comment:2

resolution: → notabug
status: newclosed

Agreed, invalid HTML has undefined results.