Q:

Select an item in an html dropdown list only with an option Id in javascript/JQuery

I have to select an option element in a dropdown list.
My html form is generated from a xsl template and could have several dropdown list/select part.
I only know the option Id to select but not the select parent tag.
Is there a way to select an item in a dropdown list only with an option id without knowing its select parent tag ?
Thank you

A:

You can either do:
$('#optionID'.prop('selected', true);

Or:
$('#optionID').closest('select').val($('#optionID').val());

