data

object data extends Tag with Attr

The <strong>HTML <code><data></code> element</strong> links a given content with a machine-readable translation. If the content is time- or date-related, the <a title="The HTML <time> element represents either a time on a 24-hour clock or a precise date in the Gregorian calendar (with optional time and timezone information)." href="/en-US/docs/Web/HTML/Element/time"><code><time></code></a> element must be used. object - The address of the resource as a valid URL. At least one of <strong>data</strong> and <strong>type</strong> must be defined. a, abbr, address, area, article, aside, audio, b, base, bdi, bdo, big, blockquote, body, br, button, canvas, caption, cite, code, col, colgroup, data, datalist, dd, del, details, dfn, dialog, div, dl, dt, em, embed, fieldset, figcaption, figure, footer, form, h1, h2, h3, h4, h5, h6, head, header, hr, html, i, iframe, img, input, ins, kbd, keygen, label, legend, li, link, main, map, mark, menu, menuitem, meta, meter, nav, noscript, object, ol, optgroup, option, output, p, param, picture, pre, progress, q, rp, rt, ruby, s, samp, script, section, select, small, source, span, strong, style, sub, summary, sup, table, tbody, td, textarea, tfoot, th, thead, time, title, tr, track, u, ul, var, video, wbr - Forms a class of attributes, called custom data attributes, that allow proprietary information to be exchanged between the <a href="/en-US/docs/Web/HTML">HTML</a> and its <a href="/en-US/docs/Glossary/DOM">DOM</a> representation that may be used by scripts. All such custom data are available via the <a title="The HTMLElement interface represents any HTML element. Some elements directly implement this interface, others implement it via an interface that inherits it." href="/en-US/docs/Web/API/HTMLElement"><code>HTMLElement</code></a> interface of the element the attribute is set on. The <a title="The HTMLElement.dataset property allows access, both in reading and writing mode, to all the custom data attributes (data-&#47;) set on the element, either in HTML or in the DOM. &nbsp;It is a map of DOMString, one entry for each custom data attribute. &nbsp;Note that the&nbsp;dataset&nbsp;property itself can be read, but not&nbsp;directly written. &nbsp;Instead, all writes must be&nbsp;to its &quot;properties&quot;, which in turn represent the data attributes. &nbsp; Note also that an HTML data-attribute&nbsp;and its&nbsp;corresponding DOM&nbsp;dataset.property&nbsp;do not share the same name, but they are always similar:" href="/en-US/docs/Web/API/HTMLElement/dataset"><code>HTMLElement.dataset</code></a> property gives access to them.

trait Attr
trait Tag
class Object
trait Matchable
class Any

Type members

Classlikes

final class WithDash(@inline sub: String) extends AnyVal
object tag extends TagElement

Types

type tagType = tag

Inherited types

type supports[T <: Tag] = AttrPair[attrType] => AttrPair[tagType]
Inherited from
Attr

Value members

Concrete methods

@inline
def -(sub: String): WithDash
@inline
def :=(v: String): AttrPair[_data_attr]
@inline
def :=(v: Option[String]): OptionalAttrPair[_data_attr]
@inline
def apply(mods: TagMod[tag]*): WithAttrs[tagType]