i need to try select the dropdown, when i was checked the check box value that corresponding value was selected in the dropdown
For example when i checked the Test 2 ,the dropdown also chage the selected value as Test 2
and i need check box group code..
<html>
<head><title>Check Box</title>
<script>
$("#chk").click(function(){
$("#test option:selected")=$("#chk :checked").val()
});
</script>
</head>
<form>
<input type="checkbox" value="1" id="chk">Test 1
<input type="checkbox" value="2" id="chk">Test 2
<input type="checkbox" value="3" id="chk">Test 3
<select id="test">
<option value="1">Test 1</option>
<option value="2">Test 2</option>
<option value="3">Test 3</option>
</select>
</form>
</html>
1 Answer