JavaScriptによる出力の例
document.write()メソッドを利用する。
<html> <head> <title>document.write()</title> </head> <body> <h1>document.write()のテスト</h1> <script language="javascript"> document.write("Hello, JavaScript<br>"); document.write("出力のテストです。"); msg = "<br>変数に代入された文字列です。"; document.write(msg + "<br>"); document.write("変数msgの文字列の長さは" + msg.length + "です。<br>"); </script> </body> </html>