HTML CSS examples for HTML Tag:button
The name attribute sets the name for a <button> element which is used to reference form-data after the form has been submitted, or to reference the element in a JavaScript.
Value | Description |
---|---|
name | The name of the button |
Two buttons with equal names, that submit different values when clicked:
<!DOCTYPE html> <html> <body> <form action="/action_page.php" method="get"> Choose your favorite subject:<!--from w w w . j av a 2 s . co m--> <button name="subject" type="submit" value="HTML">HTML</button> <button name="subject" type="submit" value="CSS">CSS</button> </form> </body> </html>