A RetroSearch Logo

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

Search Query:

Showing content from https://developer.mozilla.org/ja/docs/Web/API/HTMLAreaElement/hostname below:

HTMLAreaElement: hostname プãƒãƒ‘ティ - Web API

HTMLAreaElement: hostname プロパティ

Baseline Widely available

hostname は HTMLAreaElement インターフェイスのプロパティで、この <area> 要素の URL のドメイン名または IP アドレスのどちらかを含む文字列です。この URL にホスト名がない場合、このプロパティには空文字列 ("") が入ります。 IPv4 および IPv6 アドレスは、先頭の 0 が削除されるなど正規化され、ドメイン名は IDN に変換されます。

詳しくは URL.hostname を参照してください。

値

area 要素に関連付けられた URL のドメインを含む文字列です。 セッターとゲッターの両方として使用することができます。

例
<textarea id="log" rows="4" cols="100"></textarea>
<map name="infographic">
  <area
    id="area1"
    shape="rect"
    coords="184,6,253,27"
    href="/ja/docs/HTMLAreaElement"
    target="_blank"
    alt="Mozilla" />
  <area
    id="area2"
    shape="circle"
    coords="130,136,60"
    href="https://coolexample.com/"
    target="_blank"
    alt="MDN" />
</map>
// 要素が文書内にあったとします
const area1 = document.getElementById("area1");
const area2 = document.getElementById("area2");

const log = document.getElementById("log");
log.textContent = `area1 hostname: ${area1.hostname} \n`; // 'developer.mozilla.org'
log.textContent += `area2 hostname: ${area2.hostname}`; // 'coolexample.com'
仕様書 ブラウザーの互換性 関連情報

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