/ Published in: JavaScript
                    
                                        
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
String.prototype.stripTags = function () {
return this.replace(/<([^>]+)>/g,'');
}
/ Usage:
var tmp = '<a href="htpp://somespammer.com">Some Link</a>';
var safe= tmp.stripTags(); // Returns "Some Link";
Comments
 Subscribe to comments
                    Subscribe to comments
                
                