Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[zh-cn]: create docs for HTMLTimeElement #23079

Merged
merged 4 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions files/zh-cn/web/api/htmltimeelement/datetime/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: HTMLTimeElement:dateTime 属性
slug: Web/API/HTMLTimeElement/dateTime
l10n:
sourceCommit: 835c199410845eed61aaf8439cb2e9719e7e9f98
---

{{ APIRef("HTML DOM") }}

**`HTMLTimeElement.dateTime`** 是一个反映 [`datetime`](/zh-CN/docs/Web/HTML/Element/time#datetime) HTML 属性的字符串,包含元素日期和时间值的机器可读形式。
fuchunhui marked this conversation as resolved.
Show resolved Hide resolved

## 值

一个字符串。对于有效的字符串格式,请参见 [`datetime` 有效值](/zh-CN/docs/Web/HTML/Element/time#有效的日期时间值)。

## 示例

```js
// 假设 HTML 中有 <time id="t"> 元素
const t = document.getElementById("t");
t.dateTime = "6w 5h 34m 5s";
```

## 规范

{{Specifications}}

## 浏览器兼容性

{{Compat}}

## 参见

- 它所属的 {{domxref("HTMLTimeElement")}} 接口。
35 changes: 35 additions & 0 deletions files/zh-cn/web/api/htmltimeelement/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
title: HTMLTimeElement
slug: Web/API/HTMLTimeElement
l10n:
sourceCommit: 7e6e5f5d4c1c984af3d4ebf9399042d19eccea1e
---

{{ APIRef("HTML DOM") }}

**`HTMLTimeElement`** 接口提供特定的属性(除了常规 {{domxref("HTMLElement")}} 接口之外,它还可以通过继承来使用),用于操作 {{HTMLElement("time")}} 元素。
fuchunhui marked this conversation as resolved.
Show resolved Hide resolved

{{InheritanceDiagram}}

## 实例属性

_从其父接口 {{domxref("HTMLElement")}} 继承属性。_

- {{domxref("HTMLTimeElement.dateTime")}}
- : 一个反映 [`datetime`](/zh-CN/docs/Web/HTML/Element/time#datetime) HTML 属性的字符串,包含元素日期和时间值的机器可读形式。

## 实例方法

_无特定方法;从其父接口 {{domxref("HTMLElement")}} 继承方法。_

## 规范

{{Specifications}}

## 浏览器兼容性

{{Compat}}

## 参见

- 实现此接口的 HTML 元素:{{HTMLElement("time")}}。