0

当我单击一个按钮时,我正在尝试选择某个选项的下拉菜单

我有

html

   <select id='selectmenu'>
    <option>
    1
    </option>
    <option>
    2
    </option>
    <option>
    3
    </option>   

    </select>

    <a id='click'>click</a>

jQuery

  $('#click').click(function(){

      var option=3;
      //I want the select dropdown menu to select option 3 when I click the button. 
      //$('#selectmenu').select()  //I think it will be something like this....

    })

谢谢您的帮助!

4

1 回答 1

5
$('#selectmenu').val(3); //p00f!
于 2012-12-04T21:42:36.440 回答