The charset
attribute on a <script> tag specifies what character set is used in the script.
If not specified, the character set will be set to UTF-8.
A charset
attribute on a <script> element.
<script src="/tutorial/script-async.js" charset="utf-8">
</script>
The charset
attribute informs the browser the character set to use.
This attribute can be specified in each page.
The default character set is UTF-8 for HTML5 documents.
<script charset="charset">
Here is when charset
support started for each browser:
Chrome
|
8.0 | Dec 2010 |
Firefox
|
3.6 | Jan 2010 |
IE/Edge
|
10.0 | Sep 2012 |
Opera
|
15.0 | May 2013 |
Safari
|
5.1 | Oct 2011 |
Back to <script>