I have the following selection field (I cannot add a class or identifier to the selection form, so I wrapped it in a div):
<div id="test"><select name="wpv-yr">
<option value="0" selected="selected">All Years</option>
<option value="2010">2010 (6)</option>
<option value="2011">2011 (12)</option>
<option value="2012">2012 (32)</option>
<option value="2013">2013 (129)</option>
<option value="2014">2014 (24)</option>
</select></div>
And I do not want to show the latest version of 2014 in the drop-down list. I tried to add:
jQuery(document).ready(function() {
jQuery("div#test option[value=2014]").remove();
});
I also tried single quotes around the value:
jQuery(document).ready(function() {
jQuery("div#test option[value='2014']").remove();
});
But that didn't work either. Option 2014 is still listed.
Where am I mistaken?
source
share