@NedalsApr 06.2008 — #That last post of mine does not work. ?
Parsing HTML is not the easiest thing to do.
This will extract the tag name of only the first tag in a line. <i> </i>var text = "some text followed by a <tag>word</tag>and more text"; var data = st(text); alert(data)
function st(ip) { var str = ip; return str.replace(/^.*?<(.*?)>.+$/,"$1"); }
If you have multiple or nested tags, it can get really complicated.
This will extract the tag name of only the first tag in a line. <i> </i>var text = "some text followed by a <tag>word</tag>and more text"; var data = st(text); alert(data)
function st(ip) { var str = ip; return str.replace(/^.*?<(.*?)>.+$/,"$1"); }
If you have multiple or nested tags, it can get really complicated.[/QUOTE]
Nothing nested, no, basically what it is is that I am going for a sort of XMLish format. Anyway, I got it working, thanks!!