This java script function will help you to validate the html data typed into the text box. It prints whether the data typed into the form is valid or not.
Features
The javascript function will help you to find whether data entered into textbox has valid HTML tags(<>) or not.
This can also be used for form validation, to check whether the form has valid html tag or not.
Just copy the code in to your page and use it.
Preview
Enter HTML data
Downloads
<!--Script by hscripts.com--> <!-- more scripts @ https://www.hscripts.com --> <script type="text/javascript"> function validate() { str=(document.getElementById('exp')).value; if(str.match(/([\<])([^\>]{1,})*([\>])/i)==null) alert("No HTML Tag"); else alert("Contains HTML Tag"); } </script> <input type=text name=exp id=exp /> <input type=button value=Enter onClick="validate()"> <!-- Script by hscripts.com -->