samedi 25 février 2017

change select tags by choosing first and check a checkbox

I have dynamic number of select tag and a checkbox all i need is a simple javascript code when i change the first select tag and check the checkbox all other selected will change to the same as the first tag

<input type="checkbox" id="mycheck">
<select id="first">
<option value='1'>1</option>
<option value='2'>2</option>
<option value='3'>3</option>
</select>
<select id="second">
<option value='1'>1</option>
<option value='2'>2</option>
<option value='3'>3</option>
</select>
<select id="third">
<option value='1'>1</option>
<option value='2'>2</option>
<option value='3'>3</option>
</select>
<select id="fourth">
<option value='1'>1</option>
<option value='2'>2</option>
<option value='3'>3</option>
</select>

when i change the first select and check the checkbox the other select changes to the same as first select thanks inadvance




Aucun commentaire:

Enregistrer un commentaire