菜鸟教程 tryjsref_anchor_charset 在线代码实例

运行 保存 全屏 右侧展示 实时查看
主题:

 <a id="w3s" charset="ISO-8859-1" href="http:/">W3Cschool</a><br>

<script>
document.write("Return charset of link: ");
document.write(document.getElementById('w3s').charset);
document.write("<br><br>");
</script>

<a id="google" href="http://www.google.com/">Google</a><br>

<script>
document.getElementById('google').charset="utf-8";
document.write("Set charset of link to: ");
document.write(document.getElementById('google').charset);
</script>