has no method 'siblings'

后端 未结 2 780
执念已碎
执念已碎 2021-01-18 18:32

Im trying to change a sibling of a div element and this is the statement i used

$(\'.edit\').click(function(){
    this.siblings(\'.innerInfo\').html(\"succe         


        
2条回答
  •  悲哀的现实
    2021-01-18 18:57

    You're should reference $(this) like:

    $('.edit').click(function(){
        $(this).siblings('.innerInfo').html("success");
    });
    

提交回复
热议问题