I have Select and all values is disabled, how can I set the value to this Select?
<select id="testselect">
<option disabled>1</option>
<option disabled>2</option>
<option disabled selected="selected">3</option>
</select>
alert($("#testselect").val()); //result null
jsfiddle
Try This ==>
alert($('#testselect option[disabled]:selected').val());
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
<select id="testselect">
<option disabled>1</option>
<option disabled>2</option>
<option disabled selected>3</option>
</select>
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