Skip to main content

Bug Tracker

Side navigation

#1569 closed bug (fixed)

Opened September 06, 2007 01:30AM UTC

Closed November 18, 2007 02:39AM UTC

create jQuery elemnent for <option> bug

Reported by: LuckyKing Owned by:
Priority: major Milestone: 1.2.2
Component: core Version: 1.1.4
Keywords: Cc:
Blocked by: Blocking:

If you create a jQuery element by $("<option>"), you will get an element like this: "<option selected />", which the attribute 'selected' will be set as default and cann't be changed.

$(document.createElement('<option>')) is ok.

Attachments (0)
Change History (3)

Changed September 27, 2007 10:01PM UTC by davidserduke comment:1

Interesting. It appears that in FF2 at least (using firebug) the first option in the select is automatically selected. So in the code with

wrap = [1, "<select>", "</select>"];

you get

div.innerHTML = "<select><option></select>";

which creates the option that is selected. Putting wrap to

wrap = [1, "<select><option>", "</select>"];

would solve the problem on creation but the code isn't set up to unwrap it correctly which would require a special case. Just my observations in case they are useful. :)

Changed September 27, 2007 10:15PM UTC by davidserduke comment:2

I just thought of one possibility. The wrap could be changed to

wrap = [1, "<select multiple>", "</select>"];

so it won't force the only option to be selected. I'm not sure if there are any other side effects but it is one possible thing to look into if you really want to fix this bug.

Changed November 18, 2007 02:39AM UTC by davidserduke comment:3

resolution: → fixed
status: newclosed

This fix was implemented for #1074 with [3844].