has no method 'siblings'

后端 未结 2 756
执念已碎
执念已碎 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");
    });
    
    0 讨论(0)
  • 2021-01-18 19:14

    Use $(this) instead of this.

    0 讨论(0)
提交回复
热议问题