Forms in HTML
Forms are used to collect user input on a web page. HTML provides several form elements, including:
<input> for text input, checkboxes, radio buttons, and more
<select> for dropdown menus
<textarea> for multi-line text input
<button> for buttons that can trigger actions
Here's an example of a simple form:
html
<form>
<label for="name">Name:</label>
<input type="text" id="name" name="name">
<label for="email">Email:</label>
<input type="email" id="email" name="email">
<label for="message">Message:</label>
<textarea id="message" name="message"></textarea>
<button type="submit">Send</button>
</form>
This form has three fields for name, email, and message, and a submit button.
No comments:
Post a Comment