I have a two dropdown's with the list of items 2 and 6 respectively. When i select first dropdown item, the list of items in second one will be 6 and when i select other value in first dropdown, the list of items should be 5 in second dropdown,
Please find the code here:
<select id="firstdropdown">
<option value="1">Test</option>
<option value="2">Testing</option>
</select>
<select id="seconddropdown">
<option value="1">test1</option>
<option value="2">test2</option>
<option value="3">test3</option>
<option value="4">test4</option>
<option value="5">test5</option>
<option value="6">test6</option>
</select>
Can anyone suggest me a solution in jquery or javascript?
5or6, or you want there to be5or6items available in the second select? Your question is not clear. Also, SO questions should include any code you have written yourself to find a solution.