Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. Element
  4. id

Element: id property

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

Theid property of theElement interfacerepresents the element's identifier, reflecting theidglobal attribute.

If theid value is not the empty string, it must be unique in a document.

Theid is often used withgetElementById() to retrieve a particular element.Another common case is to use an element'sID as a selector when styling the document withCSS.

Note:Identifiers are case-sensitive, but you should avoid creatingIDs that differ only in the capitalization.

Value

A string.

Specifications

Specification
DOM
# ref-for-dom-element-id①

Browser compatibility

See also

  • The DOMidglobal attribute.

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp