jquery replaceWith()

jquery replaceWith()

replaceWith() 方法用指定的 HTML 内容或元素替换被选元素。

参考案例 http://www.w3school.com.cn/jquery/manipulation_replacewith.asp

$(".btn1").click(function(){ 
$("p").replaceWith("<b>Hello world!</b>");
}
);

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注