HTML
<data>
element
links a given piece of content with a machine-readable translation. If the content is time- or date-related, the
<time>
element must be used.
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
| 内容类别 | 流内容 , 措词内容 ,可触及内容。 |
|---|---|
| 准许内容 | 措词内容 . |
| Tag omission | None, both the starting and ending tag are mandatory. |
| Permitted parents | Any element that accepts 措词内容 . |
| Implicit ARIA role | 无对应角色 |
| Permitted ARIA roles | 任何 |
| DOM 接口 |
HTMLDataElement
|
This element's attributes include the 全局属性 .
value
This attribute specifies the machine-readable translation of the content of the element.
The following example displays product names but also associates each name with a product number.
<p>New Products</p> <ul> <li><data value="398">Mini Ketchup</data></li> <li><data value="399">Jumbo Ketchup</data></li> <li><data value="400">Mega Jumbo Ketchup</data></li> </ul>
| 规范 | 状态 | 注释 |
|---|---|---|
|
HTML 实时标准
The definition of '<data>' in that specification. |
实时标准 | 无变化自 HTML5 |
|
HTML5
The definition of '<data>' in that specification. |
推荐 | 初始定义。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
data
|
Chrome 完整支持 62 | Edge 完整支持 ≤18 | Firefox 完整支持 22 | IE 不支持 No | Opera 完整支持 49 | Safari 完整支持 10 | WebView Android 完整支持 62 | Chrome Android 完整支持 62 | Firefox Android 完整支持 22 | Opera Android 完整支持 46 | Safari iOS 完整支持 10 | Samsung Internet Android 完整支持 8.0 |
完整支持
不支持
<time>
元素。