HTML value Attribute

❮ HTML Attributes


<form action="action3.html" method="get">
	Click the button.
	<button name="subject" type="submit" value="HTML">HTML</button>
	<button name="subject" type="submit" value="CSS">CSS</button>
	<button name="subject" type="submit" value="JavaScript">JavaScript</button>


The value attribute defines the value for elements(initial value for some elements).

Standard Syntax

<element value="text">

Browser Support


Applies to:

The value attribute can be used on the following element:

Element Attribute
<button> value
<data> value
<input> value
<li> value
<meter> value
<option> value
<param> value
<progress> value

Attribute Values

Value Description
text Specifies the value of the button.

<data> Tag Example

<p>Product List</p>
	<li><data value="001">Book</data></li>
	<li><data value="002">Pen</data></li>
	<li><data value="003">Pencil</data></li>

<input> Tag Example

<form action="action.php">
	<label for="fname">First name:</label>
	<input type="text" id="fname" name="fname" value="John"><br><br>
	<label for="lname">Last name:</label>
	<input type="text" id="lname" name="lname" value="Doe"><br><br>
	<input type="submit" value="Submit">

<li> Tag Example

	<li value="three">One</li>

<meter> Tag Example


<p><label for="a">A score:</label>
<meter id="a" min="0" low="40" high="90" max="100" value="60"></meter></p>

<p><label for="b">B score:</label>
<meter id="b" min="0" low="40" high="90" max="100" value="85"></meter></p>

<option> Tag Example


<form action="action.php">
<label for="lang">Choose a language:</label>

<select id="lang" name="lang">
  <option value="HTML">HTML</option>
  <option value="CSS">CSS</option>
  <option value="JavaScript">JavaScript</option>
<input type="submit" value="Submit">

<param> Tag Example


<object data="demo/video.mp4">
	<param name="videplay" value="true">

<progress> Tag Example


<label for="loading">Loading progress:</label>
<progress id="loading" value="55" max="100"> 55% </progress>
❮ HTML Attributes