Home Python C Language C ++ HTML 5 CSS Javascript Java Kotlin SQL DJango Bootstrap React.js R C# PHP ASP.Net Numpy Dart Pandas Digital Marketing

HTML Form Elements:

Sure! Form elements in HTML allow users to input data that can be submitted to a server for processing. Here are some commonly used form elements:

Input:

  1. Select:

    • <select>: A dropdown list for selecting one option from multiple choices.
      • <option>: Defines an option in a <select> dropdown.
  2. Textarea:

    • <textarea>: A multi-line text input field for entering longer text.
  3. Button:

    • <button>: A clickable button that can perform custom JavaScript actions.

Here's an example demonstrating the usage of these form elements:

<form action="/submit-form" method="post">
<label for="username">Username:</label>
<input type="text" id="username" name="username" required><br>
<label for="password">Password:</label>
<input type="password" id="password" name="password" required><br>
<label for="email">Email:</label>
<input type="email" id="email" name="email" required><br>
<label for="age">Age:</label>
<input type="number" id="age" name="age" min="18" max="100"><br>
<label for="gender">Gender:</label>
<input type="radio" id="male" name="gender" value="male">
<label for="male">Male</label>
<input type="radio" id="female" name="gender" value="female">
<label for="female">Female</label><br>
<label for="country">Country:</label>
<select id="country" name="country">
<option value="usa">USA</option>
<option value="canada">Canada</option>
<option value="uk">UK</option>
</select><br>
<label for="message">Message:</label><br>
<textarea id="message" name="message" rows="4"></textarea><br>
<input type="checkbox" id="agree" name="agree">
<label for="agree">I agree to the terms and conditions</label><br>
<button type="submit">Submit</button>
<button type="reset">Reset</button>
</form>


These form elements allow users to interact with your website and submit data, which can then be processed on the server-side.




Advertisement





Q3 Schools : India


Online Complier

HTML 5

Python

java

C++

C

JavaScript

Website Development

HTML

CSS

JavaScript

Python

SQL

Campus Learning

C

C#

java