HTML <script> charset attribute
HTML <script> tag
Example
Define the character encoding used in a linked script file:
<script type="text/javascript" src="myscripts.js"
charset="UTF-8"></script>
|
Try it yourself!
|
Definition and Usage
The charset attribute specifies the character encoding used in an external
script file (referred to by the
src attribute).
The charset attribute is used when the character encoding in an external
script file differs from the encoding in the main file.
The default character encoding is ISO-8859-1.
Browser Support

The charset attribute is supported in all major browsers.
Syntax
Attribute Values
Value |
Description |
character_encoding |
The character encoding of an external script file.
Some common values:
- "ISO-8859-1" - Standard encoding for the Latin alphabet
- "UTF-8" - Character encoding for Unicode. Compatible with ASCII
Look at
our Character-sets reference
for a complete list of character sets.
|
HTML <script> tag
Learn XML with <oXygen/> XML Editor - Free Trial!
 |
|
oXygen helps you learn to define,
edit, validate and transform XML documents. Supported technologies include XML Schema,
DTD, Relax NG, XSLT, XPath, XQuery, CSS.
Understand in no time how XSLT and XQuery work by using the intuitive oXygen debugger!
Do you have any XML related questions? Get free answers from the oXygen
XML forum
and from the video
demonstrations.
Download a FREE 30-day trial today!
|
|