What would be the regex to remove a variable string like the following in the html?
<% include Banner %>
Here's what I've tried so far:
$('body').html().replace('<%(.*?)%>','');
What would be the regex to remove a variable string like the following in the html?
<% include Banner %>
Here's what I've tried so far:
$('body').html().replace('<%(.*?)%>','');
You might want to set your html, turn your regex into a regex and change your < to <
var $body = $('body');
$body.html($body.html().replace(/<%(.*?)%>/,''));
Demo: http://jsfiddle.net/7nWyA/
If jQuery finds < and > when it's not actually a html tag it will replace it with < and >
and turn your regex into a regex The sentence of the day