这个函数有jQuery版本吗?
string strip_tags(string $ str [,string $ allowable_tags])
从字符串中删除其中的所有标记和内容,但允许的标记字符串中定义的除外.
喜欢:
var stripped = strip_tags($('#text').html(), '<p><em><i><b><strong><code>');
Run Code Online (Sandbox Code Playgroud)
从:
<div id="text">
<p> paragraph </p>
<div> should be stripped </div>
</div>
Run Code Online (Sandbox Code Playgroud)