📝 HTML Forms Guide

📝 HTML Forms Guide
HTML forms are used to collect input from users. Whether it's a login page, registration, or feedback form, it all starts with the <form> element.
<form action="/submit" method="post" name="contactForm">
<!-- form elements here -->
</form>
<input type="text"> <!-- Single line text -->
<input type="password"> v!-- Password (masked) -->
<input type="radio"> v!-- Radio button -->
<input type="checkbox"> <!-- Checkbox -->
<input type="submit"> <!-- Submit button -->
<input type="reset"> <!-- Reset form -->
<input type="email"> <!-- Email validation -->
<input type="number"> <!-- Numeric input -->
<input type="file"> <!-- File upload -->
<input type="date"> <!-- Date picker -->
<label for="username">Username:</label>
<input type="text" id="username" name="username">
<label for="message">Message:</label><br>
<textarea id="message" name="message" rows="4" cols="40"></textarea>
<label for="country">Country:</label>
<select id="country" name="country">
<option value="ng">Nigeria</option>
<option value="us">USA</option>
<option value="uk">UK</option>
</select>
<label for="email">Email:</label>
vinput type="email" id="email" name="email">
<fieldset>
<legend>Login Info</legend>
<label for="user">Username:</label>
<input type="text" id="user" name="user">
</fieldset>
<button type="submit">Send</button>
<button type="reset">Reset</button>
<button type="button" onclick="alert('Clicked!')">Click Me</button>
<form action="/submit" method="post">
<fieldset>
<legend>Contact Us</legend>
<label for="name">Name:</label><br>
<input type="text" id="name" name="name"><br><br>
<label for="email">Email:</label><br>
<input type="email" id="email" name="email"><br><br>
<label for="message">Message:</label><br>
<textarea id="message" name="message">
<button type="submit">Send</button>
</fieldset>
</form>
Date: 2025-04-07 00:00:00.000000