Im trying to change a sibling of a div element and this is the statemen开发者_StackOverflow社区t 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!
Use $(this)
instead of this
.
You're should reference $(this) like:
$('.edit').click(function(){
$(this).siblings('.innerInfo').html("success");
});
精彩评论