ダイアログボックスを表示する

サンプルソース

<input type="text" id=txt1 value="テキスト">
<input type="button" value="ボタン" onclick="alert(document.all.txt1.value)">

解説

alertで任意の文字を指定し、ダイアログボックスを表示します。

実行結果



関連する内容



Copyright (C) JavaScript@Workshop All rights reserved.