Mat*_*att 2 javascript jquery attr
以下代码不起作用,因为attr未定义:
$("#foo a[href]").each(function()
{
this.attr("href", "www.google.com");
});
Run Code Online (Sandbox Code Playgroud)
但是这段代码确实:
$("#foo a[href]").each(function()
{
this.href = "www.google.com";
});
Run Code Online (Sandbox Code Playgroud)
为什么??
| 归档时间: |
|
| 查看次数: |
5572 次 |
| 最近记录: |