Advertisement
Home Open Editor ❯

HTML <script> charset Attribute

Deprecated: Not Supported in HTML5.

Example

<script charset="UTF-8" src="demo-script-charset.js"></script>

Try this code ❯

Meaning

The charset attribute specifies the character encoding used in an external script file. It is used when the character encoding in an external script file differs from the encoding in the HTML document.

Note: The charset attribute is only for external scripts.


Standard Syntax

<script charset="characterSet">


Advertisement

Attribute Values

Value Description
characterSet Specifies the character encoding for the document. The HTML5 specification recommend to use the UTF-8 character set!
Home Open Editor ❯
Advertisement