HTMLAreaElement.toString()

HTMLAreaElement.toString()文字列化メソッドで、 URL 全体の入った文字列を返します。 これは、 HTMLAreaElement.href の読み取り専用バージョンです。

構文

toString()

引数

なし。

返値

なし (undefined)。

エリア要素で toString を呼び出す

// <area id="myArea" href="/en-US/docs/HTMLAreaElement"> 要素が文書にあったとします
const area = document.getElementById("myArea");
area.toString(); // 'https://developer.mozilla.org/en-US/docs/HTMLAreaElement' を返す

仕様書

Specification
HTML Standard
# dom-hyperlink-href-dev

ブラウザーの互換性

BCD tables only load in the browser

関連情報