Selecting an option by it's value
Posted
by Ross
on Stack Overflow
See other posts from Stack Overflow
or by Ross
Published on 2010-06-12T00:25:53Z
Indexed on
2010/06/12
0:32 UTC
Read the original article
Hit count: 656
jQuery
|jquery-selectors
I'm trying to run this jQuery selector:
$("#label option[value=\"newLabel\"]")
On the following code:
<select name="label" id="label">
<option value="1" label="testLabel">testLabel</option>
<option value="newLabel" label="New Label">New Label</option>
</select>
But the selector just won't find it - can anyone spot where I'm going wrong?
© Stack Overflow or respective owner