Skip to main content

HTML Guide

Element “script” must not have attribute “charset” unless attribute “src” is also specified.

The charset attribute on a <script> element can be used to specify the character encoding of an external script, whose URL should be specified on the src attribute.

If the script is not external, then the charset attribute should not be used, as the character encoding of the HTML document will be used.

Learn more:

Related W3C validator issues