For JavaScript beginners, they often forget to hide JavaScript code in old browsers (such as Netscape Navigator 1.12. You may ask why to hide it? The reason is that the old browser does not support JavaScript. If you do not take the correct measures, your JavaScript source code will be displayed in the old browser, just like HTML, so you must hide JavaScript. Specifically, you can use some HTML statements to easily hide Javascript from the old browser.
The Code is as follows:
Browsers that support JavaScript will interpret this code, while the old browser will only regard it as HTML, and it has been commented out, so it achieves the purpose of hiding JavaScript code. You may want to add some text
In fact, there are very few browsers that do not support JavaScript. Even if there are, there are almost no people using that browser. This label can be ignored during normal production. But then again, it is very important for a programmer to cultivate good programming habits. Of course, it starts from a trivial matter.