Reputation: 11010
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!
Upvotes: 5
Views: 7506
Reputation: 6726
You're should reference $(this) like:
$('.edit').click(function(){
$(this).siblings('.innerInfo').html("success");
});
Upvotes: 0