Bug Tracker

Opened 9 years ago

Closed 9 years ago

#14495 closed bug (notabug)

Select .val() select a ghost option

Reported by: [email protected] Owned by:
Priority: low Milestone: None
Component: attributes Version: 1.10.2
Keywords: Cc:
Blocked by: Blocking:


With this html :

<select id="select">

<option value="1">Option 1</option> <option value="2">Option 2</option> <option value="3">Option 3</option>


And this command : $('#select').val(0);

It's okay with jQuery 1.9 but wrong with 1.10.* ! jQuery 1.10 select a ghost empty option ?!

Change History (1)

comment:1 Changed 9 years ago by gibson042

Component: unfiledattributes
Priority: undecidedlow
Resolution: notabug
Status: newclosed

The new behavior is correct; that "ghost empty option" is purely a display artifact of setting selectedIndex to -1. See #13514, 48d71d0c, and PR 1191 for details.

Note: See TracTickets for help on using tickets.