Yahoo India Web Search

Search results

  1. The <fieldset> tag is used to group related elements in a form. The <fieldset> tag draws a box around the related elements.

    • Embed

      W3Schools offers free online tutorials, references and...

    • Overview
    • Try it
    • Attributes
    • Styling with CSS
    • Examples
    • Browser compatibility
    • See also

    The HTML element is used to group several controls as well as labels ( ) within a web form.

    As the example above shows, the element provides a grouping for a part of an HTML form, with a nested element providing a caption for the . It takes few attributes, the most notable of which are form, which can contain the id of a on the same page, allowing you to make the part of that even if ...

    This element includes the global attributes.

    disabled

    If this Boolean attribute is set, all form controls that are descendants of the , are disabled, meaning they are not editable and won't be submitted along with the . They won't receive any browsing events, like mouse clicks or focus-related events. By default browsers display such controls grayed out. Note that form elements inside the element won't be disabled.

    form

    This attribute takes the value of the id attribute of a element you want the to be part of, even if it is not inside the form. Please note that usage of this is confusing — if you want the elements inside the to be associated with the form, you need to use the form attribute directly on those elements. You can check which elements are associated with a form via JavaScript, using HTMLFormElement.elements.

    name

    There are several special styling considerations for .

    Its display value is block by default, and it establishes a block formatting context. If the is styled with an inline-level display value, it will behave as inline-block, otherwise it will behave as block. By default there is a 2px groove border surrounding the contents, and a small amount of default padding. The element has min-inline-size: min-content by default.

    If a is present, it is placed over the block-start border. The shrink-wraps, and also establishes a formatting context. The display value is blockified. (For example, display: inline behaves as block.)

    There will be an anonymous box holding the contents of the , which inherits certain properties from the . If the is styled with display: grid or display: inline-grid, then the anonymous box will be a grid formatting context. If the is styled with display: flex or display: inline-flex, then the anonymous box will be a flex formatting context. Otherwise, it establishes a block formatting context.

    Simple fieldset

    This example shows a really simple example, with a , and a single control inside it.

    Disabled fieldset

    This example shows a disabled with two controls inside it. Note how both the controls are disabled due to being inside a disabled .

    BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

    •The element

    •The element

    •The element

    •The element

  2. May 29, 2023 · Learn how to use the tag to group related form controls and add a border and a caption to them. See examples of syntax, attributes and output with HTML5 fieldset tag.

  3. Learn how to use the HTML tag to group related fields in a form and style them with CSS. See syntax, attributes, examples and browser support for this element.

  4. Oct 18, 2023 · Learn how to use the HTML fieldset element to group related form elements, enhance user experience, and improve accessibility. See examples, CSS styling, and common pitfalls to avoid.

  5. Apr 19, 2017 · <fieldset> In This Article. The HTML <fieldset> element is used to group several controls as well as labels ( <label>) within a web form.

  6. People also ask

  7. Dec 2, 2010 · <fieldset> The <fieldset> element represents a set of form controls optionally grouped under a common name. Point. The name of the group is given by the first legend element that is a child of the fieldset element, if any. The remainder of the descendants form the group. HTML Attributes. disabled = boolean

  1. People also search for