When i displayPHP-generated SELECT dropdown lists, it's easy to insert SELECTED in the appropriate <option> that matches the current value in PHP.
I have now the situation of a static html <SELECT> list of States and Provinces.
I would like to have SELECTED programatically applied thru JS according to a PHP-generated variable.
Thus I need a JS function or statement that somehow does the SELECT even tho the STATES dropdown list is static in html.
What code can i use for this?
In the following excerpt example, say that i can insert <?=$SelectedStateAbbreviation?> wherever it's needed in the JS.
<SELECT name=State >
<option value='CA'>California </option>