i have dropdownlist with the 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");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With