close

[JavaScript HTML DOM]使用document物件,取得標題名稱,使用屬性document.title

說明:
document.title

此範例設計說明:
第一步、取得title
程式:
<html>
<head>
<title>[JavaScript-HTML_DOM]使用document物件,取得標題名稱,使用屬性document.title</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<input type="button" value="測試" onclick="mytest()" />
<script>
function mytest() {
document.write(document.title);
}
</script>
</body>
</html>
圖:


按下測試,取得title


相關範例:






 






 















其它文章

arrow
arrow

    PG Levin Li 發表在 痞客邦 留言(0) 人氣()