Jquery Attr()未显示

Jquery Attr()未显示,jquery,Jquery,我不明白为什么attr()不起作用(参见下面的代码)。我可以在源代码中看到带有属性的正确标记,标记正在创建,但在网站上不可见 app.html('<h1>' + product.name + '</h1><img src="' + product.img + '" width="300"></img><a></a>'); $('a').attr("href", product.link); app.html(“”+prod

我不明白为什么attr()不起作用(参见下面的代码)。我可以在源代码中看到带有属性的正确标记,标记正在创建,但在网站上不可见

app.html('<h1>' + product.name + '</h1><img src="' + product.img + '" width="300"></img><a></a>');
$('a').attr("href", product.link);
app.html(“”+product.name+“”);
$('a').attr(“href”,product.link);

标签中没有内容。这就是为什么

1st标签

1st:使用网站上不可见的。这是因为

哦,是的。我想我得睡觉了:)谢谢!