jquery获取DIV里的内容包含html标记,然后进行替换,在返回给DIV

2024-11-23 22:19:54
推荐回答(2个)
回答1:

var s = $("#content").html();

s = s.replace(/n/g, "替换n的内容");
s = s.replace(/#/g, "替换#的内容");
s = s.replace(/j/g, "替换j的内容");
s = s.replace(/h/g, "替换h的内容");
$("#content").html(s);

回答2:

for there is a companionship of books