jQuery Show Content Based on Select Option

2014-09-21 • Snippets • Views: 1675

jQuery Show Content Based on Select Option

[php]
jQuery(function () {
jQuery(‘#select_ID’).change(function () {
var selected = $(this).find(‘:selected’).val();
jQuery(".item_to_hide").hide();
jQuery(‘#’ + selected).show();
}).change();
});
[/php]

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Shares