重複の可能性:
パスワード HTML リダイレクト
以下のコードに問題があります。具体的window.location="http://www.google.com"
には、正しいパスワードを入力してもリダイレクトできません。
<div class="buttons">
<input class="orangebutton" type="submit" value="Continue" onclick="if (document.getElementById('password').value == 'hi') window.location="http://www.google.com" else alert('Wrong Password!');" />
</div>
更新: これは私が今持っているものです。リダイレクトはまだ機能していません。
<input class="orangebutton" type="submit" value="Continue" onclick="if (document.getElementById('password').value == 'hello') window.location='http://www.google.com'; else alert('Wrong Password!');" />