Atribut formulir HTML <input>

tag <input> HTML

Contoh

Bidang input yang terletak di luar formulir HTML (tetapi masih merupakan bagian dari formulir):

<form action="/action_page.php" id="form1">
  <label for="fname">First name:</label>
  <input type="text" id="fname" name="fname"><br><br>
  <input type="submit" value="Submit">
</form>

<label for="lname">Last name:</label>
<input type="text" id="lname" name="lname" form="form1">

Definisi dan Penggunaan

Atribut formmenentukan bentuk <input>elemen milik.


Dukungan Peramban

Angka-angka dalam tabel menentukan versi browser pertama yang sepenuhnya mendukung atribut tersebut.

Attribute
form Yes Yes Yes 5.1 10.6

Sintaksis

<input form="form_id">

Nilai Atribut

Value Description
form_id Specifies the form element the <input> element belongs to. The value of this attribute must be the id attribute of a <form> element in the same document.

tag <input> HTML