Change() inside each() jQuery

前端 未结 4 2122
抹茶落季
抹茶落季 2020-12-18 06:36

What is the best way to manage this kind of situation :

$(\'.element\').each(function() {

    $sibling = // find a sibling to $this.
    $mainElement = $(         


        
4条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-18 07:09

    Try with this

    $('.element').each(function() {
        $(this).siblings('.sibling').change(function() {
           var mainElement = $(this).siblings('.element');
            // Play here
        });
    });
    

提交回复
热议问题