jQuery (almost) equivalent of PHP's strip_tags()

后端 未结 9 842
忘掉有多难
忘掉有多难 2020-11-27 04:50

Is there a jQuery version of this function?

string strip_tags( string $str [, string $allowable_tags ] )

stri

9条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-27 05:21

    To remove all tags, could use:

    var StrippedString = OriginalString.replace(/(<([^>]+)>)/ig,"");
    

    Code from: Strip HTML Tags in JavaScript

提交回复
热议问题