HTML5 is not a brand new thing, but most people do not know much about HTML5. (If You Want To Know HTML5, you can view the HTML5 video published by IE9 .) Although the latest mainstream browsers, such as IE9, Firefox4, and Chrome10, have begun to support HTML5 features ...,. HTML5 is not a brand new thing, but most people do not know much about HTML5. (If You Want To Know HTML5, you can view the HTML5 video published by IE9 .) Although mainstream browsers, such as IE9, Firefox4, and Chrome10, have started to support HTML5 features in the new version, all browsers currently have incomplete support for HTML5, this is mainly because HTML5 is still in the preparation process. If you want to check whether your browser supports the features of HTML 5, you can refer to one of the methods described below.
When a browser renders a web page, it constructs a Document Object Model (DOM ). This is a set of objects used to represent HTML elements on a page. Every element, such as every
, Each
Each object has a different DOM object representation. Of course, there is also a global object, such as window and document, but they are not used to represent specific elements.
All DOM objects have some common attributes and their own unique attributes. Browsers that support the HTML 5 feature will include this unique attribute. Therefore, we can use this technology to detect what new features the browser supports. Later in this section, we will introduce this technology in detail from ease to difficulty.
Modernizr -- HTML 5 detection Library
Modernizr is an open-source JavaScript HTML 5 Feature Detection Library Based on the MIT protocol. It can detect many features of HTML 5 and CSS 3. You can find the latest version (the current version is 1.7) on its home page or here's address (modernizr-1.7.min.js, pay attention to modifying the suffix ). Like other JS libraries, you should introduce them in the head block:
Dive Into HTML5