the murmurous sea

HTML5: data- 본문

#dev/개념정리

HTML5: data-

lunacer 2020. 4. 17. 12:16

for Embedding custom non-visible data with the data-* attributes

-

Any attribute that starts with data- will be treated as a storage area for private data. Additionally, this won't affect the layout or presentation.

-

A custom data attribute is an attribute in no namespace whose name starts with the string "data-", has at least one character after the hyphen, is XML-compatible, and contains no ASCII upper alphas.

these attributes are intended for use by the site's own scripts, and are not a generic extension mechanism for publicly-usable metadata.

-

Every HTML element may have any number of custom data attributes specified, with any value.

-

User agents must not derive any implementation behavior from these attributes or values. Specifications intended for user agents must not define these attributes to have any meaningful values.

-

element . dataset
Returns a DOMStringMap object for the element's data-* attributes.
-
Hyphenated names become camel-cased. For example, data-foo-bar="" becomes element.dataset.fooBar.

 

 

read more:
https://dololak.tistory.com/364

 

[자바스크립트] 데이터 속성(data-xxx)에 대해

데이터 속성 HTML5부터는 데이터 속성이라는 개념이 생겼습니다. 데이터 속성은 HTML 요소의 'data-' 로 시작하는 속성입니다. 이러한 데이터 속성은 특정한 데이터를 DOM 요소에 저장해두기 위함이 목적입니다...

dololak.tistory.com

https://html.spec.whatwg.org/multipage/dom.html#domstringmap

 

HTML Standard

Every XML and HTML document in an HTML UA is represented by a Document object. [DOM] The Document object's URL is defined in DOM. It is initially set when the Document object is created, but can change during the lifetime of the Document object; for exampl

html.spec.whatwg.org

 

'#dev > 개념정리' 카테고리의 다른 글

JS ES5: forEach vs map  (0) 2020.04.29
Tree of nodes / DOM  (0) 2020.04.22
CSS: Grid  (0) 2020.04.16
CSS: vertical alignment - centering  (0) 2020.04.15
HTML. semantic / non-semantic elements  (0) 2020.04.13
Comments