Hi, I write in javascript.
I have an html-string in a variable and like to retrieve all the tag names in one array and all the non-html-contents of those tags in a second array:
e.g.
html_string: <h1>This is a headline</h1>
<p>But I have more <b> to offer </b>. There is still a lot of content to see</p><font size="+1">Do you see it?</font>
Here I need two regular expressions. First should result in an array with
0 => h1
1 => p
2 => b
3 => font
and the second with
0 => This is the headline
1 => But I have more to offer. There is still a lot of content to see
2 => to offer
3 =>Do you see it?
I just need to know what text (words) are in what html tags. Any other solution that provides me that information is fine too.
Thanks a lot in advance.
schingeldi