gistlib
<!DOCTYPE html> <html> <head> <title>Login Form</title> </head> <body> <h2>Login Form</h2> <form id="loginForm"> <label for="username">Username:</label><br> <input type="text" id="username" name="username"><br> <label for="password">Password:</label><br> <input type="password" id="password" name="password"><br><br> <button type="button" onclick="login()">Login</button> </form> <script> function login() { const username = document.getElementById('username').value; const password = document.getElementById('password').value; // You can add your own authentication logic here if (username === 'admin' && password === 'password') { alert('Login successful'); } else { alert('Login failed. Please try again.'); } } </script> </body> </html> 927 chars31 lines
<!DOCTYPE html> <html> <head> <title>Login Form</title> </head> <body> <h2>Login Form</h2> <form id="loginForm"> <label for="username">Username:</label><br> <input type="text" id="username" name="username"><br> <label for="password">Password:</label><br> <input type="password" id="password" name="password"><br><br> <button type="button" onclick="login()">Login</button> </form> <script> function login() { const username = document.getElementById('username').value; const password = document.getElementById('password').value; // You can add your own authentication logic here if (username === 'admin' && password === 'password') { alert('Login successful'); } else { alert('Login failed. Please try again.'); } } </script> </body> </html>
gistlibby LogSnag