javascript - How to target a div by class name inside another class -


i have divs this.

<div class"parent">     <div class"child">      stuff here     </div> </div>   <div class"parent">     <div class"child">      other kinda stuff here     </div> </div> 

i want click parent class , show child class inside parent without showing other children classes in other parent classes.

$(document).on('click', '.parent', function(){     $(this).find($('.child').show(500)); }); 

pass selector string find() not object - passing jquery object. have invalid html because class"parent" should class="parent".

demo

$(document).on('click', '.parent', function(){     $(this).find('.child').show(500); }); 

Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -