Is there a way to check if a tag is valid html tag and / or supported by the browser ? Like if I type text "hi" in a set of p1 tag, browsers wont show anything in display, but p1 is not a valid html tag. How to check this using javascript ?
If you want to test whether HTML5 tags and attributes are supported, you can use Modernizr—it's a JavaScript file you include which does the work for you. It also adds support for things like <section>
and <header>
to the browser using JavaScript so you can go ahead and use them without fear.
If you want to be sure that an XHTML 1.0 or HTML4 tag is supported… well, you can assume it is. No one uses Netscape 4 any more.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With