I am trying to create a pattern to prevent user inputs from HTML mark up. I created this patten
var htmlTagRegex = /^<+[a-z]+>/;
which only works when the input starts with html tag for example:
<br /> Test
<p> Test
<div> Test
but in case of having an input like below
Test <br />
Test <p>
Test <div>
the pattern not working (probably because of /^). How can I write the pattern to consider any html tag contains?