Skip to main content

Bug Tracker

Side navigation

#5176 closed bug (invalid)

Opened September 08, 2009 04:00AM UTC

Closed October 31, 2010 09:20AM UTC

Inserted elements with unbalenced quotes become unselectable

Reported by: brianfreud Owned by:
Priority: major Milestone: 1.4
Component: core Version: 1.3.2
Keywords: Cc:
Blocked by: Blocking:
Description

$("body").append('<div id=foo">');

console.log($("#foo").length);

Note that there is a " missing before foo. At least in FF3.0.13, <div id="foo"></div> does get created, and fireBug does show it has the id attribute set, but the created element is invisible to jQuery; note that fireBug reports 0, not 1, as the length on any following attempts to select that div.

Attachments (0)
Change History (2)

Changed June 13, 2010 05:31PM UTC by dmethvin comment:1

component: unfiledcore

Changed October 31, 2010 09:20AM UTC by snover comment:2

resolution: → invalid
status: newclosed

Don’t pass invalid HTML to jQuery. It’s invalid; it won’t work right.