HTML - attributes - v....

revision:


"value" attribute : specifies the value of an element

The value attribute is used to specify the value of the element with which it is used. It has different meaning for different HTML elements.
The value attribute can be used on the following elements: <button>, <input>, <meter>, <li>, <option>, <progress>, <param>.

For <button>, <input> and <option> elements, the value attribute specifies the initial value of the element.

For <li> elements, the value attribute sets the value of the list item (for ordered lists). The next list items will increment from that value.

For <meter> elements, the value attribute specifies the current value of the gauge.

For <progress> elements, the value attribute specifies how much of the task has been completed.

For <param> elements, the value attribute specifies the value of the parameter.

syntax

<element value="value "></element>

some examples

example
Choose your favorite subject:

codes:

                    <form style="margin-left:3vw;" action="/action_page.php" method="get">
                        Choose your favorite subject:
                        <button name="subject" type="submit" value="fav_HTML">HTML</button>
                        <button name="subject" type="submit" value="fav_CSS">CSS</button>
                    </form>
                

example
  1. Coffee
  2. Tea
  3. Milk
  4. Water
  5. Juice
  6. Beer

codes:

                    <ol style="margin-left:3vw;">
                        <li value="100">Coffee</li>
                        <li>Tea</li>
                        <li>Milk</li>
                        <li>Water</li>
                        <li>Juice</li>
                        <li>Beer</li>
                    </ol>