<html>
<body>
<script id="myScript" type="text/javascript">
document.write("Hello World!");
</script>
<p>点击按钮返回脚本的 type 属性的值。</p>
<p id="demo"></p>
<button onclick="myFunction()">尝试一下</button>
<script>
function myFunction()
{
var x = document.getElementById("myScript").type;
document.getElementById("demo").innerHTML = x;
};
</script>
</body>
</html>