I want to select all the select elements that have a value of “-1” and change the value to blank aka “”.
I want to change all these:
<option value="-1">Select Something</option>
to this:
<option value="">Select Year</option>
I am using this code:
jQuery().ready(function() {
$("option[value='-1']").val('');
});
… which isn’t working. Any idea why?
You can select options with a specific value like this:
and then set a new value with the
valfunction:DEMO