A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://developer.mozilla.org/ja/docs/Web/API/HTMLButtonElement/labels below:

HTMLButtonElement: labels プãƒãƒ‘ティ - Web API

HTMLButtonElement: labels プロパティ

Baseline Widely available

HTMLButtonElement.labels は読み取り専用プロパティで、この <button> 要素に関連付けられた <label> 要素を NodeList で返します。

値

NodeList で、この <button> 要素に関連付けられた <label> 要素を返します。

例 HTML
<label id="label1" for="test">Label 1</label>
<button id="test">Button</button>
<label id="label2" for="test">Label 2</label>
JavaScript
window.addEventListener("DOMContentLoaded", () => {
  const button = document.getElementById("test");
  for (const label of button.labels) {
    console.log(label.textContent); // "Label 1" and "Label 2"
  }
});
結果 仕様書 ブラウザーの互換性

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4