Javascript Function: strip_tags()

A useful function to strip all HTML tags and markup from a string.

function strip_tags(str) {
return str.replace(/</?(?!!)[^>]*>/gi, '');
}