Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

<HTMLDivElement> has no method 'siblings'

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

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

It keeps throwing the <HTMLDivElement> has no method 'siblings' exception, and i really cant figure out why. I've initiated jQuery and ive started the script on document.ready

thanks for your help!

like image 727
nkcmr Avatar asked Jun 03 '11 15:06

nkcmr


1 Answers

Use $(this) instead of this.

like image 190
Salman von Abbas Avatar answered Oct 28 '22 14:10

Salman von Abbas