Easy Tutorial
❮ Dom Obj Fileupload Prop Range Type ❯

Anchor charset Attribute


Definition and Usage

The charset attribute can set or return the value of the charset attribute of a link.

The charset attribute specifies the character set of the linked resource.

Syntax

Setting the charset attribute:

Returning the charset attribute:

Value Description
charset Specifies the character set of the linked resource

Browser Support

All major browsers support the charset attribute.


Example

Returning the charset attribute value of a link:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>tutorialpro.org(tutorialpro.org)</title>
</head>
<body>

<a id="tutorialpro" charset="ISO-8859-1" href="//www.tutorialpro.org/">tutorialpro.org</a><br>
<script>
document.write("Returning the link's charset: ");
document.write(document.getElementById('tutorialpro').charset);
document.write("<br><br>");
</script>
<a id="google" href="//www.google.com/">Google</a><br>
<script>
document.getElementById('google').charset="utf-8";
document.write("Setting the link's charset: ");
document.write(document.getElementById('google').charset);
</script>

</body>
</html>

❮ Dom Obj Fileupload Prop Range Type ❯