HTML slt;button> name property
The name property sets the name of the button in HTML to submit some values, please refer to below for detailed usage of the property.
The two buttons have the same name and submit different values when you click them:
Choose your favorite subject:
<button name="subject" type="submit" value="HTML">HTML</button>
<button name="subject" type="submit" value="CSS">CSS</button>
</form>
Try it out . . .
Browser support
The name property is supported by all major browsers.
Definitions and usages
The name property specifies a name for the button.
The name property is used to reference elements in JavaScript, or to reference form data after a form is submitted.
Tip: Different button elements can share the same name. This allows you to mark several buttons with the same name so that different values can be submitted when used in a form.
The difference between HTML 4.01 and HTML5
No.
Grammar
The property value
value | describe |
---|---|
name | The name of the specified button. |
HTML slt;button-and-label