I am currently working on creating a dependency between two select boxes. The jQuery code I have implemented works perfectly on most common browsers such as Chrome and Firefox, but it seems to have some issues with Internet Explorer, Edge, and some mobile browsers.
jQuery(document).ready(function($){
$("#selectbox-dependency").change(function() {
if ($(this).val() == "Banana") { //value of selectbox #1
$(".yellow").show(); //classes for each of the options in selectbox #2
$(".red").hide();
$(".black").hide();
$(".gold").hide();
}else if ($(this).val() == "cherry"){
$(".yellow").hide();
$(".red").show();
$(".black").hide();
$(".gold").hide();
}
});
});
Thank you!