Now HTML5 seems to be slowly becoming popular. For the sake of compatibility, some front-end experts will add code to judge the client browser in the web page to know whether the user's browser supports HTML5. Below I will share two methods that I use myself. Method
Method 1,
<script> function checkhHtml5() { if (typeof(Worker) !== "undefined") { alert("支持HTML5"); } else { alert("不支持HTML5"); } } </script>
Method 2,
<canvas id="Canvas" ></canvas> <script> if (!document.getElementById("Canvas").getContext) { alert("不支持html5"); } else{ alert("支持html5"); } </script>
If there is a better way, please contact me! Thank you