0

here is my html how to change selection form based on this:

<select id="myclass">
<option value="one">Form one</option>
<option value="two">Form two</option>
</select>

I chose "Form one" it show me only select id="one" or it I chose "Form two" it show me only select id="two"

<select id="one">
<option value="one1">one1</option>
<option value="one2">one2</option>
</select>

<select id="two">
<option value="two1">two1</option>
<option value="two2">two2</option>
</select>
mat7777
  • 37
  • 1
  • 7

2 Answers2

0

Something like this:

$('#myclass').change(function(){
   $('#one').hide();
   $('#two').hide();
   $('#'+$(this).val()).show();
});
Renan Araújo
  • 3,533
  • 11
  • 39
  • 49
ernesthm
  • 421
  • 4
  • 15
0

You can do this by Jquery as follows:

$('#myclass').change(function(){
       $('#one, #two').hide();
       $('#'+$(this).val()).show();
    });
John Wink
  • 295
  • 1
  • 2
  • 12