Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JavaScript Handling the Submit Event</title> </head> <body> <form action="/examples/html/action.php" method="post" onsubmit="alert('Form data will be submitted to the server!');"> <label>First Name:</label> <input type="text" name="first-name" required> <input type="submit" value="Submit"> </form> </body> </html>