タイトル名を表示する

サンプルソース

<title>タイトル名</title>
<input type="button" value="ボタン" onclick="alert(document.title);">

解説

document.titleはページのタイトル名を返します。
HTMLのtitleタグに設定している文字列です。

実行結果



関連する内容



Copyright (C) JavaScript@Workshop All rights reserved.