open closest container div with jquery -


i have question. have html. in readmore box, there lot of content. , how more .readmore-open links , readmore boxes on web page.

<p> <a href="http://staging.triple-b-it.nl/requirements-management/" title="lees verder" class="readmore-open">lees verder</a> </p>  <div class="readmore-box">  </div> 

now question. when click .readmore-open link. first readmore-box coming, must show. have script. doing wrong.

$('.readmore-open').click(function(e){     $(this).closest('.readmore-box').toggleclass('active'); }) 

$('.readmore-open').click(function(){     $(this).closest('p').next('.readmore-box').toggleclass('active'); }); 

your dom traversal bit off.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -