Skip to content

Commit

Permalink
2023/04/07 時点の英語版に基づき新規翻訳
Browse files Browse the repository at this point in the history
  • Loading branch information
mfuji09 committed Jul 9, 2023
1 parent 35800cf commit 5ba5d08
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions files/ja/web/api/htmlprogresselement/labels/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
title: "HTMLProgressElement: labels プロパティ"
short-title: labels
slug: Web/API/HTMLProgressElement/labels
l10n:
sourceCommit: 595cba0e07c70eda7f08a12890e00ea0281933d3
---

{{APIRef("DOM")}}

**`HTMLProgressElement.labels`** は読み取り専用プロパティで、この {{HTMLElement("progress")}} 要素に関連付けられている {{HTMLElement("label")}} 要素の {{domxref("NodeList")}} を返します。

##

この `<progress>` 要素に結びつけられている `<label>` 要素の入った {{domxref("NodeList")}} です。

##

### HTML

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

### JavaScript

```js
window.addEventListener("DOMContentLoaded", () => {
const progress = document.getElementById("test");
for (const label of progress.labels) {
console.log(label.textContent); // "Label 1" and "Label 2"
}
});
```

### 結果

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

## 仕様書

{{Specifications}}

## ブラウザーの互換性

{{Compat}}

0 comments on commit 5ba5d08

Please sign in to comment.