im trying to get the currently selected option in a dropdown menu with javascript. but i cant seem to get it to work
my current js:
var itemqual = $("select#itemqual option:selected").text(); var type = "hat"; $('select#itemtype').change(function() { if(itemtype == type) { $('#graphic').show(); } else { $('#graphic').hide(); } }); however when I change the selection it doesnt work.