i have dropdownlist with th开发者_运维问答e values:
<select id="myddl" name="myddl">
<option value="1">One</option>
<option value="2">Twooo</option>
<option value="3">Three</option>
</select>
I need to change the text Twooo
to Two
using the value of the dropdownlist option(2)
. How can i do it in jquery?
$('#myddl option[value=2]').text('Two');
var myDLLField = $('select[id="myddl"]');
myDLLField.find('option[value="2"]').text("Two");
or, in one line...
$('select[id="myddl"]').find('option[value="2"]').text("Two");
精彩评论