For ex. we have
<select id="menu">
<option value="1">sample 1</option>
<option value="2">sample 2</option>
</select>
and
<input type="radio" id="parentcheck" value="1">Button 1
<input type="radio" id="parentcheck" value="2">Button 2
I want to simply “clone” user input. Let’s say we want to set them to exact values and trigger their functions.
In my case i have functions for both of them
$("#menu").change(function () {...
$(".parentcheck").click(function () {...
For ex. how to select Sample 1 and Button 1 and fire their function?
For the first case you can use
.val()and trigger the event manually in both cases.Consider the following
In the above, we select the option with the value of 2.
And for the radio buttons