I need some help with this. Basically I have the following code which I have been using. I’m not sure if will help or not…
$('#options-1').change(function () {
-----blahblah
});
options-1 is my drop down menu. It has two options, one with value ‘1’ and another with value ‘2’. Could you guys please help me come up with something that does the following:
When I select the option with value ‘1’ it should do this:
1) Find an ‘li’ tag that includes an ‘img’ tag. The ‘IMG’ tag will have an ‘alt’ or ‘title’ attribute of 1, which corresponds to the value of the drop down menu (1).
2) The code should change the LI tag from:
class="" style="display: none;"
to
class="active" style="display: block;"
And, the same thing would happen if I select the option with the value ‘2’, or value ‘3’ or so on.
Thank you very much in advance! I would appreciate any help, suggestions, etc for this. As you can probably tell I’m not very experienced with javascript/jquery (yet :D).
assume your select tag looks like this:
so, your script will be:
OR use
has(thanks @Moin):OR