Skip to content

Commit

Permalink
update content
Browse files Browse the repository at this point in the history
  • Loading branch information
fuchunhui committed Aug 28, 2024
1 parent f4fe84d commit 30912a3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion files/zh-cn/web/api/htmlprogresselement/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ l10n:

{{ APIRef("HTML DOM") }}

**`HTMLProgressElement`** 接口提供特定的属性和方法(除了常规 {{domxref("HTMLElement")}} 接口之外,它还可以通过继承来使用),用于操作 {{HTMLElement("progress")}} 元素的布局和呈现
**`HTMLProgressElement`** 接口提供用于操作 {{HTMLElement("progress")}} 元素布局和呈现的特定属性和方法(除了常规 {{domxref("HTMLElement")}} 接口之外,它还可以通过继承来使用)

{{InheritanceDiagram}}

Expand Down
15 changes: 6 additions & 9 deletions files/zh-cn/web/api/htmlprogresselement/labels/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,20 @@ l10n:

{{APIRef("DOM")}}

The **`HTMLProgressElement.labels`** read-only property returns
a {{domxref("NodeList")}} of the {{HTMLElement("label")}} elements associated with the
{{HTMLElement("progress")}} element.
**`HTMLProgressElement.labels`** 只读属性返回一个与 {{HTMLElement("progress")}} 元素有关联的 {{HTMLElement("label")}} 元素的 {{domxref("NodeList")}}。

##

A {{domxref("NodeList")}} containing the `<label>` elements associated
with the `<progress>` element.
一个与 `<progress>` 元素有关联的 `<label>` 元素的 {{domxref("NodeList")}}。

## 示例

### HTML

```html
<label id="label1" for="test">Label 1</label>
<label id="label1" for="test">标签 1</label>
<progress id="test" value="70" max="100">70%</progress>
<label id="label2" for="test">Label 2</label>
<label id="label2" for="test">标签 2</label>
```

### JavaScript
Expand All @@ -32,12 +29,12 @@ with the `<progress>` element.
window.addEventListener("DOMContentLoaded", () => {
const progress = document.getElementById("test");
for (const label of progress.labels) {
console.log(label.textContent); // "Label 1" and "Label 2"
console.log(label.textContent); // “标签 1”和“标签 2”
}
});
```

{{EmbedLiveSample("Examples", "100%", 30)}}
{{EmbedLiveSample("示例", "100%", 30)}}

## 规范

Expand Down

0 comments on commit 30912a3

Please sign in to comment.