I have the following HTML:
<select class="file_image_type" name="file_image_type">
<option>Gallery</option>
<option>Feature</option>
<option>Thumbnail</option>
</select>
This is generated dynamically and is repeated for each item. Since there can only be one Feature image, I want to reset the option value of any labeled as “Feature” whenever a new image is selected as being a “Feature”.
I’ve tried this jQuery but it doesn’t seem to be responding:
current.find(".file_image_type option[value='Feature']").val("Gallery");
I’m able to set the image as Feature just fine using this:
current.find(".file_image_type").val("Feature");
People, people, you do not need to select the
options directly in jQuery. I can’t believe how many times I see this mistake.