<data>
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since octubre de 2017.
Resúmen
El Elemento HTML <data> vincula un contenido dado con una traducción legible por una máquina. Si el contenido está relacionado con time- o date-, debe usarse el elemento <time>.
| Categorías de contenido | Flow content, phrasing content, palpable content. |
|---|---|
| Contenido permitido | Phrasing content. |
| Omisión de etiqueta | Ninguna, tanto la etiqueta inicial como la final son obligatorias. |
| Elementos permitidos | Any element that accepts phrasing content. |
| interfaz DOM | HTMLDataElement |
Atributos
Este elemento incluye Atributos globales
value-
This attribute specifies the machine-readable translation of the content of the element.
Ejemplo
El siguiente ejemplo muestra nombres de productos pero también asocia a cada uno con su código UPC.
html
<p>New Products</p>
<ul>
<li><data value="3967381398">Mini Ketchup</data></li>
<li><data value="3967381399">Jumbo Ketchup</data></li>
<li><data value="3967381400">Mega Jumbo Ketchup</data></li>
</ul>
Especificaciones
| Specification |
|---|
| HTML> # the-data-element> |
Compatibilidad con navegadores
Loading…
Ver también
- The HTML
<time>element.