X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

Anchor charset Property

Anchor Object Reference Anchor Object

Definition and Usage

The charset property sets or returns the value of the charset attribute of a link.

The charset attribute specifies the character-set of the linked document (the document referenced in the href attribute).

Syntax

Set the charset property:

anchorObject.charset="charset"

Return the charset property:

anchorObject.charset

Value Description
charset Specifies the character set of the linked document


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The charset property is supported in all major browsers.


Example

Example

Return the value of the charset attribute of a specific link:

<html>
<body>

<p><a id="w3s" charset="ISO-8859-1"
href="http://www.w3schools.com">W3Schools.com</a></p>

<script>
document.write(document.getElementById("w3s").charset);
</script>

</body>
</html>

The output of the code above will be:

ISO-8859-1

Try it yourself »


Anchor Object Reference Anchor Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates FREE Website Templates Free HTML Templates

SHARE THIS PAGE

facebook