HTML DOM Document charset

Example

Get the character encoding for a document:

encoding = document.charset;
Try it Yourself »

Description

The charset property is deprecated. Do NOT use it.

The charset property may not work in future browsers.


Syntax

document.charset

Return Value

Type Description
StringThe document's character encoding.

Copyright 1999-2023 by Refsnes Data. All Rights Reserved.