Skip to content

HTML: Guidance about lists of values in attributes #277

@LeaVerou

Description

@LeaVerou

This relates to #269.

For short lists of values, current practice is to use a space or comma separated attribute. Examples:

  • Global class attribute (space separated)
  • <iframe sandbox> (space separated)
  • <input accept> (comma separated)

For larger lists of values, embedding the list in an attribute should be discouraged. Instead, current practice is to link to another element (e.g. <input list>) or to declare the list using child elements, if this is an essential part of the element (e.g. the list of <option> elements inside <select>).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: Consensus to writeWe have TAG consensus about the principle but someone needs to write it (see "To Write" project)Topic: HTML

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions