HTML slt;script> charset property
The charset property you need to use in an external file for character encoding, refer to the following example:
External JavaScript with a character set of UTF-8:
Try it out . . .
Browser support
The charset property is supported by all major browsers.
Definitions and usages
The charset property specifies the character encoding used in the external script file.
The charset property is used when the character encoding in the external script file is different from the encoding in the HTML document.
Tip: The charset property is used with the src property to tell the browser the character set to encode. Its value is the name of any ISO standard character set encoding.
Tips and comments
Note: The charset property applies only to external scripts (only when using the src property).
The difference between HTML 4.01 and HTML5
No.
Grammar
The property value
value | describe |
---|---|
charset |
Specify the character encoding of the external script file.
Some common values:
Please refer to our Character set reference manual , Get a complete character set list. |
HTML and script.html