![]() |
VOOZH | about |
The HTML DOM Script charset property is used to set or return the value of a charset attribute of an <script> element. The charset attribute is used to specify the character encoding used in an external script.
Syntax:
scriptObject.charset
scriptObject.charset = charset
Property Values: It contains single value charset which specifies the character encoding used in an external script.
Return Value: It returns a string value that represents the character encoding of the script element.
Example: This example illustrates how to return the script charset property.
Output:
Example 2: This example illustrates how to set the script charset property.
Output:
Supported Browsers: The browsers supported by HTML DOM Script charset property are listed below: