Sorry total js newbie here
I got this JS code from another stackoverflow question
$(document).ready(function(){
$('#cart').on('change', function() {
if ( this.value == '1')
{
$(".tea").show();
}
else
{
$(".coffee").hide();
}
});
});
It worked for the other guy, but not for me, what am I possibly doing wrong?
http://codepen.io/anon/pen/waexVV
It should change the image from Coffee to tea when Tea is selected, but it only changes the image when you select tea and the coffee again
I have no idea what I did wrong, I only want to show one image and hide the other(s) when an item from the dropdown is selected
I am using bootstrap-select could there be a problem with this plugin?
Thanks a lot
Even you can operate on your class to hide element:
http://codepen.io/anon/pen/GJEXge