Advertisement
Home Open Editor ❯

HTML value Attribute

Example

<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>
</form>

Try this code ❯

Meaning

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


Standard Syntax

<element value="text">


Applies to:

The value attribute can be used on the following element:


Advertisement

Attribute Values

Value Description
text Specifies the value of the button.

<data> Tag Example

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

Try this code ❯


<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">
</form>

Try this code ❯


<li> Tag Example

<ol>
  <li value="three">One</li>
  <li>Two</li>
  <li>Three</li>
</ol>

Try this code ❯


<meter> Tag Example

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>

Try this code ❯


<option> Tag Example

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>
</select>
<input type="submit" value="Submit">
</form>

Try this code ❯


<param> Tag Example

Example

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

Try this code ❯


<progress> Tag Example

Example

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

Try this code ❯

Home Open Editor ❯
Advertisement