HTML <フィールドセット>属性

❮HTML<fieldset>タグ

name属性を持つ<fieldset>:

<form action="/action_page.php" method="get">
  <fieldset name="personalia">
    <label for="fname">First name:</label>
    <input type="text" id="fname" name="fname">
  </fieldset>
  <br>
  <button type="button"
  onclick="form.personalia.style.backgroundColor='yellow'">
  Change background color of fieldset</button>
  <input type="submit">
</form>

定義と使用法

このname属性は、フィールドセットの名前を指定します。

このname属性は、JavaScriptの要素を参照するため、またはフォームの送信後にフォームデータを参照するために使用されます。


ブラウザのサポート

Attribute
name Yes 11.0 Yes Yes Yes

構文

<fieldset name="text">

属性値

Value Description
name Specifies the name of the fieldset

❮HTML<fieldset>タグ