I'm needing to wrap all of the characters within a string inside of their own tag. I've been able to do that with the following:
$(".text").html(function(index, html) {
return html.replace(/(\w)/g, "<span>$&</span>");
});
This works, but I need it to also ignore any HTML tags. For example, this string:
'Text here<br>Text Here'
Currently it's ignoring the <>, but wrapping the "b" and "r" with span tags. Is it possible to ignore the entire html tag?