●サンプルコード(実行する) <html> <head> <title>escape test</title> <script language="JavaScript"><!-- function check() { txt = document.forms[0].test.value; alert(escape(txt)); return false; } // --></script> </head> <body> 改行コード (JS) テスト結果<br> <form onSubmit="return check()"> <textarea name="test"> 1 2 </textarea> <input type="submit" value="送信"><br><br> </form> </body> </html>