coding exercise Basic Form Validation
Exercise 5: Basic Form Validation HTML (index.html): <!DOCTYPE html> <html lang=”en”> <head> <meta charset=”UTF-8″> <meta name=”viewport” content=”width=device-width, initial-scale=1.0″> <link rel=”stylesheet” href=”styles.css”> <title>Form Validation</title> </head> <body> <div class=”form-container”> <form onsubmit=”validateForm(); return false;”> <label for=”username”>Username:</label> <input type=”text” id=”username” required> <br> <label for=”password”>Password:</label> <input type=”password” id=”password” required> <br> <button type=”submit”>Submit</button> </form> <p id=”errorMessage” class=”error-message”></p> </div> <script src=”script.js”></script> </body> … Read more