I made this regex:
/\<+[a-zA-Z0-9\=\"\s]+\>+.+\<\/+[a-zA-Z0-9]+\>/gi
which matches a full html tag like:
<p>this is a paragraph</p>
But the problem with this that that it matches all of the elements as one match
<div><p>this is a paragraph</p></div>
But I would like to get all of the HTML elements separated.
Note: The HTML tags are in a string not in the DOM.
Before the regex solution I tried to create a new div element and I added the string as it's innerHTML. But doesn't worked properly I don't really know why...
So I'm looking for a REGEX solution which solves this one match problem.
Thanks
innerHTMLattempt.innerHTML(or some similar mechanism) is actually the right solution.