I have a string with HTML code:
let string = '<span><p>Hello</p></span>';
I want to change all the substrings between < and > to a div element. Here is the desired result:
let desired = '<div><div>Hello</div></div>';
Sort of like .replace(), except the inside of the <> could be anything.
Please avoid Regex if possible. Thanks!