projectmonkey projectmonkey - 2 months ago 12
CSS Question

Bootstrap show/hide li items based on li clicked in first dropdown

I am trying to show

li
items with a certain class in a second bootstrap dropdown based on the
li
item selected in the first dropdown.

$(document).ready(function() {
$('#mapContent').hide();
$('#mapCat').click(function(){
$("#mapContent").show();
$("#mapContent ul li .show1").hide();
});
})


Here is my fiddle

Answer

You have a space li .show1 which tells jquery to search for children of li but you want the li, remove it to get the li's

$("#mapContent ul li.show1").hide();