$('#bar3').live('click', function() {
if($('#bar3').attr('class') == '0') {
console.log("closed")
} else if($('#bar1' && '#bar2').attr('class') == '0') {
console.log("Both")
} else if($('#bar1').attr('class') == '0') {
console.log("Summary Open")
} else if($('#bar2').attr('class') == '0') {
console.log("HIP Open")
} else {
console.log("open")
}
});
Why does this not work?
I know what it’s doing, I just don’t know what to change to fix it.
This part is wrong:
else if($('#bar1' && '#bar2').attr('class') == '0')
should be
&& is a valid java script operator, but not valid as part of a jquery selector.