要删除 标记,而不 除去 content ,这就是PHP的
strip_tags()行为,您可以执行以下操作:
var whitelist = "p"; // for more tags use the multiple selector, e.g. "p, img"$("#text *").not(whitelist).each(function() { var content = $(this).contents(); $(this).replaceWith(content);});


