How to check if an HTML element is supported by a browser

Is there a way to check if the tag is a valid html tag and / or is supported by the browser? For example, if I type “hello” in the set of p1 tag, browsers will not be displayed, but p1 is not a valid html tag. How to check this with javascript?

+5
source share
1 answer

If you want to check if HTML5 tags and attributes are supported, you can use Modernizr - this JavaScript file that you include that does the work for you. It also adds support for browsers, for example, <section>and <header>so you can use them without fear.

, XHTML 1.0 HTML4... , , . Netscape 4.

+7

All Articles