I created 2 input, one is Radio Button, and one is Dropdown. I want user to click on radio button and it will select the option in the dropdown with the same value.
How can I do this with JS, not using Jquery?
Please help me with this.
Thank you!
My sample code:
<p class="line-item-property__field">
<label>Color</label><br>
<input type="radio" name="color" value="1"> <span>1</span><br>
<input type="radio" name="color" value="2"> <span>2</span><br>
<input type="radio" name="color" value="3"> <span>3</span><br>
</p>
<p class="line-item-property__field">
<label>Color</label><br>
<select id="your-name" name="dropdown-color">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</p>
2