我正在尝试使用 jQuery 更改页面中的 html。虽然它在 Firefox 中工作,但它不会在 chrome 中工作。我该怎么做才能解决这个问题?
例如。
$('#test').html(<p>hi</p>);
会很好地更改文本,但如果我在文件中有其他 html 并用它覆盖它,旧文本仍显示在 chrome 中。这可能是缓存问题吗?我该如何解决?
最佳答案
你漏掉了引号。
$('#test').html("<p>hi</p>");
关于javascript - jQuery 无法使用 .html() 更改 html,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18755555/