SyntaxFix
Write A Post
Hire A Developer
Questions
Try checking for the :visible property instead.
if($('#car2').not(':visible')) { alert('car 2 is hidden'); }