HTML <input> name eigenschap
Definitie en gebruik
name
Eigenschap die de naam van het <input>-element definieert.
name
Eigenschap gebruikt om elementen in JavaScript te refereren, of om formulierdata te refereren na het indienen van een formulier.
Note:Only those name
Form elements with the attribute can pass their values when submitting the form.
Example
An HTML form that contains three input fields, two text fields, and a submit button:
<form action="/action_page.php"> <label for="fname">Name:</label> <input type="text" id="fname" name="fname"><br><br> <label for="lname">Surname:</label> <input type="text" id="lname" name="lname"><br><br> <input type="submit" value="Submit"> </form>
Syntax
<input name="text">
Attribute value
Value | Description |
---|---|
text | Specify the name of the <input> element. |
Browser support
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support |