"type="text/javascript"" is usually used in conjunction with the script tag to indicate that the text belongs to a javascript script; the type attribute of the script tag is used to set the MIME type of the script and set the type to javascript script Language is used for script execution.
The operating environment of this tutorial: Windows 10 system, JavaScript version 1.8.5, Dell G3 computer.
type="text/javascript"What does it mean
Put between <script></script> is the text type (text).
javascript tells the browser that the text inside belongs to javascript script.
The required type attribute specifies the MIME type of the script.
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".
The syntax is:
<script type="value">
where MIME_type represents the MIME type. Some of the values:
text/javascript
text/ecmascript
application/ecmascript
application/javascript
text/vbscript
[Related recommendations: javascript learning Tutorial】
The above is the detailed content of What does type='text/javascript' mean?. For more information, please follow other related articles on the PHP Chinese website!