In javascript, the function of text/javascript is to tell the browser to parse according to JavaScript. IE browser defaults to javascript, but other browsers may not, which can prevent the browser from using other parsing methods. and version compatibility issues.
The operating environment of this tutorial: windows7 system, javascript version 1.8.5, Dell G3 computer.
It makes no difference whether text/javascript is written or not. However, it is recommended to write
text/javascript to tell the browser to parse according to JavaScript
The default of IE browser is javascript, but other browsers may not
In order to prevent the browser from using other parsing and version compatibility issues, it is better to write it
Extension information:
The required type attribute specifies the MIME of the script type.
The type attribute identifies the content between the <script> and </script> tags.
MIME types consist of two parts: media type and subtype. For JavaScript, the MIME type is "text/javascript".
Both the type and language attributes can be used to specify the type of script in the