سمة شكل <button> HTML

❮ علامة <button> HTML

مثال

زر خارج النموذج (لكنه لا يزال جزءًا من النموذج):

<form action="/action_page.php" method="get" id="form1">
<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">
</form>

<button type="submit" form="form1" value="Submit">Submit</button>

التعريف والاستخدام

تحدد السمة formالشكل الذي ينتمي إليه الزر.

يجب أن تكون قيمة هذه السمة مساوية idلسمة <form> عنصر في نفس المستند.


دعم المتصفح

تحدد الأرقام الواردة في الجدول إصدار المتصفح الأول الذي يدعم السمة بشكل كامل.

Attribute
form 10.0 16.0 4.0 5.1 9.5

بناء الجملة

<button form="form_id">

قيم السمات

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

❮ علامة <button> HTML