入力できるダイアログを表示するスクリプトです。 以下のサンプルでは、ユーザー名に tama と hana が登録されています。 <html> <head> <title>TAG index Webサイト</title> <script type="text/javascript"> <!-- function disp(){ // 入力ダイアログを表示 + 入力内容を user に代入 user = window.prompt("ユーザー名を入力してください", ""); // 入力内容が tama の場合は example_tama.html にジャンプ if(user == 'tama'){ location.href = "example_tama.html"; } // 入力内容が hana の場合は example_hana.html にジャンプ else if(user ==
![JavaScript/ウィンドウ/入力ダイアログを表示する - TAG index](https://cdn-ak-scissors.b.st-hatena.com/image/square/4f9442d6a13ed8b2d2bf932784e7d4613227a381/height=288;version=1;width=512/https%3A%2F%2Fwww.tagindex.com%2Fimage%2Fogp%2Fjavascript.png)