HTML value attribute

value attribute defines the initial value in the input field, user visible name of the button, customized list item markers, and the values of options for the puprpose of user interface.

Example

<form action="files/value.php" method="post">
 <input type="text" name="fullname"value="name">
 <input type="submit" name="submit" value="send">
 </form>
Try </>

values of value attribute

The value of value attribute is plain text or valid floating point number.

Related tags

The tags that support this attribute are given below.

<input> tag

It defines an input field that allows the user to enter data. value attribute specifies the initial value in the input control. The user can interact with value and modify the value. The current value is submitted with the form.

See the first example.

<option> tag

option tag defines an option. This value is sent with the form.

In the above example, if we select Chips then actually the value of option is selected i.e. [email protected].

<data> tag

value attribute defines the machine-readable value of the content.

Example

<data value="LP122">Laptop Model</data>

Try</>

value attribute is used by the micro processors.

<li> tag

li tag defines list item. value attribute gives a customized value to the list item markers.

Example

<ol>
<li value="50">Chair</li>
<li value="51">Table</li>
<li value="52">TV</li>
<li value="53">Laptop</li>
</ol>

Try</>

<meter> tag

value defines the current value of the bar in the meter element.

Example

<meter min="0" max="150" value="75"></meter>

Try</>

<progress> tag

It also gives current value to the progress bar.

Example

<progress value="250" max="300"></progress>

Try</>


Was this article helpful?

 

Email:

Message:

Get the newsletter