I had to do some documentation-digging to figure this one out. If you want to be able to have access to <option>’s within an HTML <select> list and fool with their properties, here is one way to do it. Hopefully this will help others who are stuck and of course to help me remember
I’m sure there are other ways to do this, if ya got one please put it up!
Example Use Case:
You need to change an <option> of a known ‘value’ to ‘selected’ , but you only know the <select> list ‘name” property.
Example Javascript:
$(document).ready(function()){
var yourVal = 13;
$(“select[name='yourselectName'] option[value='"+yourVal+"']“).attr(‘selected’, true);
}
