ヘイホー、
異なる段落の親要素に対処したいと思います。段落が別の方法でネストされているため、「最も近い」または sth を使用して同じ方法で対処することはできません..
#text-testそのため、 ANDに対処するために正規表現テストを使用しようとしています#img-test。
<div class="text-test">
    <p class"tester">texttest</p>
</div>
<div class="img-test">
   <div class="wrapper">
    <p class="tester">imgtest</p>  
   </div>
</div>
$('.tester').click(function() {
    //$(this).closest('div').addClass('active');
    /* get the closest div where the class ends up with -test
    * and add class active 
    * wrapperdiv = $(this).closest('div').attr('class').test(/-test$/);
    */
    //console.log(wrapperdiv)
});
テスト方法を使用してどのように対処できるかアドバイスはありますか?
乾杯