The <button> HTML element is an interactive element activated by a user with a mouse, keyboard, finger, voice command, or other assistive technology. Once activated, it then performs an action, such as submitting a form or opening a dialog.
Example:
Code:
<textarea name="" id="" rows="10" cols="30"> Write here... </textarea>
Output
Example:
Code:
<select name="" id="">
<option value="a">a. Tree</option>
<option value="b">b. Clude</option>
<option value="c">c. Water</option>
</select>
Output:
Example:
Code:
<input type="checkbox" name="t&c" id="selector_example">
<label for="selector_example">Accept terms & conditions</label>
Output:
Example:
Code:
<input type="radio" name="abc" id="m" value="male">
<label for="m">Male</label><br>
<input type="radio" name="abc" id="f" value="female">
<label for="f">Female</label><br>
<input type="radio" name="abc" id="o" value="others">
<label for="o">Others</label><br>
Output:
Code:
<form action="somewhere" method="get">
<fieldset >
<legend>An example form:</legend>
<!-- Text input -->
<div>
<label for="Name">Name:</label>
<input type="text" id="Name" name="name" placeholder="Full Name" required >
</div>
<!-- Radio buttons -->
<div>
<p>Gender:</p>
<input type="radio" id="male" name="gender" value="m">
<label for="male">Male</label>
<input type="radio" id="female" name="gender" value="f">
<label for="female">Female</label>
<input type="radio" id="other" name="gender" value="o">
<label for="other">Other</label>
</div>
<!-- Selector with options -->
<div>
<br>
<label for="country">Country:</label>
<select id="country" name="nation">
<option value="IN">India</option>
<option value="US">United States</option>
<option value="CA">Canada</option>
<option value="UK">United Kingdom</option>
<option value="AU">Australia</option>
</select>
</div>
<!-- Textarea -->
<div>
<br>
<label for="message">Feedback message:</label><br>
<textarea id="message" name="feedback" rows="5" cols="30"></textarea>
</div>
<!-- Checkboxes -->
<div>
<p>Hobbies:</p>
<input type="checkbox" id="reading" name="hobbies" value="reading">
<label for="reading">Reading</label>
<input type="checkbox" id="traveling" name="hobbies" value="traveling">
<label for="traveling">Traveling</label>
<input type="checkbox" id="cooking" name="hobbies" value="cooking">
<label for="cooking">Cooking</label>
<br><br>
</div>
<!-- Submit button -->
<div>
<button type="submit">Submit</button>
</div>
</fieldset>
</form>
Output: