HTML5, CSS3 and other related technologies such as Canvas, WebSocket, etc. have brought Web application development to a new level. This technology can develop the effects of desktop applications by combining HTML, CSS and JavaScript. Although HTML5 promises a lot, the browsers that HTML5 supports and the HTML5 standard itself are not yet perfected to a very mature level. Now we are not worried about browser support at all, and it will take time. Therefore, when we decide to use HTML5 technology to develop web applications, we need to detect the features supported by the browser.
Modernizr can help you check the HTML5 features supported by your browser.
The following code detects whether the browser supports Canvas:
Copy the code