0

How would I access parent div and check if it has a specific class

<div class="current">
    <img src="aaa.jpg" class="me-child">
</div>

with jquery clicking on the div and using this keyword, I want to know if parent div has the class of current

thanks

Phil Cooper
  • 3,083
  • 39
  • 63
Johny D Good
  • 427
  • 1
  • 8
  • 26

1 Answers1

1
if($(this).parent().hasClass("current")) return true;
MoeZir
  • 31
  • 3