HTML DOM Anchor charset attribute
Definition and Usage
charset charset property sets or returns the value of the link.
charset attribute specifies the character set to be linked resource.
grammar
Set the charset attribute:
anchorObject.charset="charset"
Returns the charset attribute:
anchorObject.charset
值 | 描述 |
---|---|
charset | 指定被链接资源的字符集 |
Browser Support
All major browsers support charset attribute
Examples
Examples
Returns the charset attribute value link:
<html>
<body>
<p><a id="w3s" charset="ISO-8859-1"
href="http://www.w3cschool.cc">W3Cschool.cc</a></p>
<script>
document.write(document.getElementById("w3s").charset);
</script>
</body>
</html>
<body>
<p><a id="w3s" charset="ISO-8859-1"
href="http://www.w3cschool.cc">W3Cschool.cc</a></p>
<script>
document.write(document.getElementById("w3s").charset);
</script>
</body>
</html>
Examples of the above output:
ISO-8859-1
try it"
Anchor objects