I have this snippet of code that looks for the value in a select box on change and sets a html element with the jQuery .text, the first if statement in the following code seems to work, “Green” but the “Blue” if doesn’t, Any ideas why?
$("#firstdrop").change(function() {
if ($("#firstdrop").val() == "Green") {
$('.price-tag').text('Green $5.00');
}
if ($("#firstdrop").val() == "Blue") {
$('.price-tag').text('Blue $15.00');
}
});
Help appreciated.
Thanks
I make an example for you to get the selected value from select.