Friday, January 17, 2014

[JAVASCRIPT/JQUERY] How to remove html tags from that source.

How to remove html tags from that source.

core source
HTMLVALUES.replace(/<(\/)?([a-zA-Z]*)(\s[a-zA-Z]*=[^>]*)?(\s)*(\/)?>/gi,'')


using jquery button event
$('#stripTags').click(function(){
 $('textarea[name="strReplace"]').val($('textarea[name="strReplace"]').val()
  .replace(/<(\/)?([a-zA-Z]*)(\s[a-zA-Z]*=[^>]*)?(\s)*(\/)?>/gi,'')
 return false; 
});

No comments:

Post a Comment