I have a select
field with some options in it. 我有一个select
字段,其中包含一些选项。 Now I need to select one of those options
with jQuery. 如今我须要使用jQuery选择其中一个options
。 But how can I do that when I only know the value
of the option
that must be selected? 可是当我只知道必须选择的option
的value
时,我怎么能这样作呢? this
I have the following HTML: 我有如下HTML: spa
<div class="id_100"> <select> <option value="val1">Val 1</option> <option value="val2">Val 2</option> <option value="val3">Val 3</option> </select> </div>
I need to select the option with value val2
. 我须要选择值为val2
的选项。 How can this be done? 如何才能作到这一点? .net
Here's a demo page: http://jsfiddle.net/9Stxb/ 这是一个演示页面: http : //jsfiddle.net/9Stxb/ code