button value Attribute - HTML CSS HTML Tag

HTML CSS examples for HTML Tag:button

Description

The value attribute specifies the initial value for a <button> in a <form>.

Attribute Values

Value Description
value The initial value of the button

Two buttons with equal names, that submit different values when clicked:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<form action="/action_page.php" method="get">
Choose your favorite subject:<!--   w  w  w  . java2s  .  c  o  m-->
<button name="subject" type="submit" value="fav_HTML">HTML</button>
<button name="subject" type="submit" value="fav_CSS">CSS</button>
</form>

</body>
</html>

Related Tutorials