I am trying to figure out if a link inside a LI has a class. How do I do this? Here's what I've been trying so farTrying to hide specific li's)\[code\]<a class="filtergallery" id="p" href="http://stackoverflow.com/questions/13774115/#">Portraits</a> <a class="filtergallery" id="n" href="http://stackoverflow.com/questions/13774115/#">Newborn</a> <a class="filtergallery" id="pe" href="http://stackoverflow.com/questions/13774115/#">Pets</a>\[/code\]\[code\]<ul class="portfolio-wrap"><li><a class="p" href="http://stackoverflow.com/questions/13774115/#" title="First Pic"><img src="http://stackoverflow.com/questions/13774115/#" alt="First Pic" /></a></li><li><a class="pe" href="http://stackoverflow.com/questions/13774115/#" title="Second Pic"><img src="http://stackoverflow.com/questions/13774115/#" alt="Second Pic" /></a></li><li><a class="n" href="http://stackoverflow.com/questions/13774115/#" title="Third Pic"><img src="http://stackoverflow.com/questions/13774115/#" alt="Third Pic" /></a></li><li><a class="pe" href="http://stackoverflow.com/questions/13774115/#" title="Fourth Pic"><img src="http://stackoverflow.com/questions/13774115/#" alt="Fourth Pic" /></a></li>\[/code\]jQuery:\[code\] $('.filtergallery').click(function(event){ var theid = $(this).attr('id'); $('.portfolio-wrap li').each(function(){ if (!hasClass(theid)) { // I need to see if the hyperlink inside the LI has this class...? hide(); } }); })\[/code\]