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.


<form action="files/value.php" method="post">
 <input type="text" name="fullname"value="name">
 <input type="submit" name="submit" value="send">
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.


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


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.


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


<meter> tag

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


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


<progress> tag

It also gives current value to the progress bar.


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


Was this article helpful?




Get the newsletter