<HTMLDivElement> does not have a 'siblings' method

I am trying to change a sibling div element and this is the operator I used

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

He continues to throw an exception <HTMLDivElement> has no method 'siblings', and I really cannot understand why. I initiated jQuery and ive ran the script ondocument.ready

thank you for your help!

+5
source share
2 answers

Use $(this)instead this.

+14
source

You need to reference $ (this) as:

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

All Articles