I've found an useful post here on StackOverflow, I use to hightlight specific text on a website: Link to Answer
I'll post it again (modified):
function hiliter(word) {
var rgxp = new RegExp(word, 'g');
var repl = '<span class="highlight">' + word + '</span>';
content.innerHTML = content.innerHTML.replace(rgxp, repl);
}
Now I tried to use this to find something between <
and >
hiliter('<(.*)>');
This finds the correct section I want to hightlight, but output changes from e.g. <Example>
to <(.*)>
on the page.
How do I search with this wildcard, but keep the html from the wildcard search when replacing?
Thanks in advance!