A RetroSearch Logo

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

Search Query:

Showing content from https://developer.cdn.mozilla.net/ja/docs/Web/API/HTMLSelectElement/form below:

HTMLSelectElement: form プãƒãƒ‘ティ - Web API

HTMLSelectElement: form プロパティ

Baseline Widely available

HTMLSelectElement.form は読み取り専用のプロパティで、この要素が関連付けられているフォームを表す HTMLFormElement を返します。この要素が <form> 要素に関連付けられていなかった場合は、null を返します。

値

HTMLFormElement です。

例
<form id="pet-form">
  <label for="pet-select">ペットを選択してください</label>
  <select name="pets" id="pet-select">
    <option value="dog">犬</option>
    <option value="cat">猫</option>
    <option value="parrot">オウム</option>
  </select>

  <button type="submit">送信</button>
</form>

<label for="lunch-select">ランチを選んでください</label>
<select name="lunch" id="lunch-select">
  <option value="salad">サラダ</option>
  <option value="sandwich">サンドウィッチ</option>
</select>

<script>
  const petSelect = document.getElementById("pet-select");
  const petForm = petSelect.form; // <form id="pet-form">

  const lunchSelect = document.getElementById("lunch-select");
  const lunchForm = lunchSelect.form; // null
</script>
仕様書 ブラウザーの互換性

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