The 'strip_tags' method is from php, but how to do it in javascript?
There's two solution, choose one of these according to your requirement.
Solution 1
If you simply needs to output plain text.
You can use regular expression to strip all tags from string like the code below.
var stripped = original.replace(/(<([^>]+)>)/ig,"")
Solution 2
If you have to output some simple font tags like '<p><i><b>'.
Using the strip_tags function of php.js which is a website for porting language from php to js.
After you include the library from php.js, you can write some sample like these.
//strip_tags(inputString, allowTags)
strip_tags("<script>alert('test')</script><p>Hello, world.</p>", "<p>")
result will output:
alert('test')<p>Hello, world.</p>
Hope these help. :)