小智 36
我知道这个问题是7岁.万一有人遇到这个问题,这里是没有使用.each的解决方案:
$('.theclass').attr("title", function() { return $(this).attr("title") + "Appended text." });
Run Code Online (Sandbox Code Playgroud)
str*_*ger 24
在这种情况下,$(this)不是元素$('.theclass').也许你想用each:
$('.theclass').each(function() {
$(this).attr("title", $(this).attr("title") + "Appended text.");
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
23452 次 |
| 最近记录: |