Thuộc tính HTML <form> name

❮ Thẻ <form> HTML

Thí dụ

Biểu mẫu HTML có thuộc tính tên:

<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>

Định nghĩa và Cách sử dụng

Thuộc nametính chỉ định tên của biểu mẫu.

Thuộc nametính được sử dụng để tham chiếu các phần tử trong JavaScript hoặc để tham chiếu dữ liệu biểu mẫu sau khi biểu mẫu được gửi.


Hỗ trợ trình duyệt

Attribute
name Yes Yes Yes Yes Yes

Cú pháp

<form name="text">

Giá trị thuộc tính

Value Description
text Specifies the name of the form

❮ Thẻ <form> HTML