【发布时间】:2013-02-08 22:46:33
【问题描述】:
var el = $(this); // it's a form
在某个时候:
el.replaceWith('<p>Loading...</p>');
稍后:
el.replaceWith(output);
显然 el 在第一次 replaceWith 之后不再存在...
我可以以某种方式保留el,显然是新内容吗?
【问题讨论】:
-
您可以使用
.html()替换元素内部而不替换元素本身。
标签: jquery html replacewith