ソースを表示する

サンプルソース

<input type="button" value="ボタン" onclick="alert(body.outerHTML);">

解説

outerHTMLで指定したHTML要素のソースを返します。

実行結果



関連する内容



Copyright (C) JavaScript@Workshop All rights reserved.