I have a following string array
["div", "span", "h1", "h2", "h3", "h4", "h5", "p", "br", "a", "strong", "em", "li", "ul", "ol", "b", "i", "u", "hr", "font", "pre", "q", "s", "strike", "blockquote", "sub", "sup"]
I have a string text which also contains HTML tags, I need to verify that the html tags in the paragraph text are out of those defined in string array above. Apart from these if any tags are present error has to be thrown. I saw many methods but couldn't find any simple javascript implementation of these.