我正在尝试更改 div 元素的同级元素,这是我使用的语句
$('.edit').click(function(){
this.siblings('.innerInfo').html("success");
});
它不断抛出 <HTMLDivElement> has no method 'siblings'
异常(exception),我真的不明白为什么。我已经启动了 jQuery,并在 document.ready
上启动了脚本。
感谢您的帮助!
最佳答案
使用$(this)
而不是this
。
关于jquery - <HTMLDivElement> 没有方法 'siblings',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6229198/