<html>
<body>
<script id="myScript" src="/demo/demo_script_charset.js" charset="UTF-8"></script>
<p>点击按钮返回脚本的 charset 属性的值。</p>
<p id="demo"></p>
<button onclick="myFunction()">尝试一下</button>
<script>
function myFunction()
{
var x = document.getElementById("myScript").charset;
document.getElementById("demo").innerHTML = x;
};
</script>
</body>
</html>