且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

JQUERY:如何在DIV中删除除BR和IMG之外的所有HTML标签

更新时间:2023-02-19 21:05:55

尝试一下,如果#aa的子代不是br或img,它将删除该子代.

try this, that will remove any child of #aa if that child isn't a br or an img

$("#aa").children().not("br, img").remove()