HTML <form> nama Atribut
Contoh
Formulir HTML dengan atribut nama:
<form
action="/action_page.php"
method="get" name="myForm">
<label for="fname">First name:</label>
<input type="text" id="fname"
name="fname"><br><br>
<label for="lname">Last name:</label>
<input type="text" id="lname" name="lname"><br><br>
<input
type="button" onclick="formSubmit()" value="Send form data!">
</form>
Definisi dan Penggunaan
Atribut name
menentukan nama formulir.
Atribut name
digunakan untuk referensi elemen dalam JavaScript, atau untuk referensi data formulir setelah formulir dikirimkan.
Dukungan Peramban
Attribute | |||||
---|---|---|---|---|---|
name | Yes | Yes | Yes | Yes | Yes |
Sintaksis
<form name="text">
Nilai Atribut
Value | Description |
---|---|
text | Specifies the name of the form |
tag <form> HTML