HTML charset attribute
charset
The purpose of the HTML charset attribute is to define the character encoding style of a given linked resource.
Supported elements
HTML charset attribute supports a, link, script element.
Syntax
<ElementName charset="value" >.....</ElementName>
Where ElementName is any supported element.
Type of value
Type of value of HTML charset attribute is a character set.
Value
A character encoding type.
Default value
There is no default value. But most of the modern browsers use ISO-8859-1 as a default value.
Supported doctypes
HTML 4.01 strict, HTML 4.01 transitional, HTML 4.01 frameset.
Example of HTML charset attribute with a
Result

View this example in a separate browser window
Example of HTML charset attribute with a.
Example of HTML charset attribute with link
Usage of HTML charset attribute with script
Previous: HTML charoff attribute
Next: HTML checked attribute
Test your Programming skills with w3resource's quiz.