If I have two selects like this?
<select id="A">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="mercedes">Mercedes</option>
<option value="audi">Audi</option>
</select>
<select id="B">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="mercedes">Mercedes</option>
<option value="audi">Audi</option>
</select>
How can I transfer the selected value and text from select A to select B. I don’t want this to happen in response to any change or click. I just need some way that I can at a later time sync what appears in the select B window to what’s in select A
If your two
selects are same then:You can simply try this:
You can make it through a function call also: