Buttons in HTML

Buttons in HTML
 
Buttons in HTML
  • Currently 5 out of 5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Rating: 5/5 (1 votes cast)

Thank you for rating!

You have already rated this page, you can only rate it once!

Your rating has been changed, thanks for rating!

Log in or create a user account to rate this page.


Button is an interface element. To create them use.

<input type="button" parameters>

Button parameters are listed in table 1.

Table 1. Button parameters.

Parameter

Description

name

Name of the field. Intended for the handler to identify the field. The name parameter can be omitted, in which case the value of the button is not sent to the server.

value

The name of the button, as well as its value.

Usage of these parameters and creation of buttons are shown in example 1.

Example 1. Creating a button.

<form action="/cgi-bin/handler.cgi">
  <p align="center"><input type="button" name="press" value="Click me tender (submit)"></p>
</form>

The name of the button can have any number of spaces in it.

Submit button

When user clicks on this button, the form data is sent to the server and are being processed by the specified tag form of the action parameter.

<input type="submit" parameters>

The parameters are the same as in other buttons (example 2).

Example 2. Submit button.

<form action="/cgi-bin/handler.cgi">
  <p align="center"><input type="submit"></p>
</form>

The result of the example is shown below.

Parameter name for this particular button can be omitted. If the parameter value is not specified, automatically appears a sign "Submit" (for IE) or "Submit Query" (for Netscape).

Reset button

When you press this button, the form data go back to their original value.

<input type="reset" parameters>

These parameters match those of the other buttons (example 3).

Example 3. Reset button.

<form action="/cgi-bin/handler.cgi">
  <input type="text" size="20"> <input type="reset">
</form>

The button reset and how it works is shown below.

Data in the reset button are never sent to the server.


 

Read also

Image button in HTML

Image button in HTML

Adding a form to a page in HTML

Adding a form to a page in HTML

Text field in HTML

Text field in HTML

Form elements in HTML

Form elements in HTML

Post comment

basicuse.net
html5_css
106160485398655174790

Quick navigation

General navigation