Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>Belajar Javascript - Angga Risky</title>
- <meta charset="utf-8">
- </head>
- <body>
- <form name="anggaForm">
- <label for="username">
- Username :
- </label>
- <input type="text" id="username" required placeholder="Nama User" />
- <label for="password">
- Password :
- </label>
- <input type="password" id="password" required placeholder="Kata Sandi" />
- <button type="submit" onclick="masukAkun();">
- Masuk
- </button>
- </form>
- <script>
- function masukAkun() {
- var userName = document.getElementById("username").value;
- var kataSandi = document.getElementById("password").value;
- if((userName === "angga") && (kataSandi =="123aaa")) {
- // alert("Selamat!, Kamu berhasil login!");
- window.location = "http://www.google.com";
- }
- else {
- alert("Waduh, Password kamu salah!");
- }
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement