LoginSignup
1
1

More than 1 year has passed since last update.

パスワード入力欄を、作成しよう

Posted at

ファイルに、パスワードを入れたい時があるので、
パスワードをつけたいなぁと、思いました
なので、パスワード認証画面を、投稿させていただきましたぁ

背景の設定

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>パスワード認証画面-パスワードを入力</title>
</head>
//背景
<body>
<body style="background-image: url(あんこ.jpg);">

パスワードの設定と、パスワードに正解したときのページジャンプ



<script type="text/javascript"><!--
function myEnter(){
   myPassWord=prompt("パスワードを入力して頂いて、okボタンを、押してください。","");
/パスワード
if ( myPassWord == "3-1seikatu" ){
/パスワード入力に成功したとき移動するページ
    location.href = "3-1seikatu.html";
} else if(myPassWord == "vzvvz") {
    location.href = "https://z.html";



/パスワードを間違えた
} else {
   alert( "パスワードが違います!あぁ残念" );
}

//  if ( myPassWord == String.fromCharCode(112,97,115,115,104,121) ){
   // location.href = String.fromCharcode(104,46,112,97,115,115)+".html";
//}""




//   else{
   //   alert( "パスワードが違います!あぁ残念" );
  // }
}
// --></script>
<center>
<form>

ボタンの上に置く言葉とボタンに書く言葉


/ボタンの上に置く言葉

  <p>対象年齢 G </p>
  <p>パスワード認証画面
/パスワードを入力するためのボタン 
    <input type="button" value="パスワードお願い" onclick="myEnter()">
  </p>
</form>
</center>


</body>
</html>

僕が、使用している、パスワード画面の背景は、Something went wrong
です。
ファイル名は、あんこ.jpg で、保存してください
上記が、パスワード認証画面に使う、プログラムコードです。
参考にしてください

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1