1. Веб-технологии для разработчиков
  2. Интерфейсы веб API
  3. HTMLAnchorElement
  4. HTMLHyperlinkElementUtils.hostname

This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

HTMLHyperlinkElementUtils.hostname

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since июль 2015 г..

Свойство HTMLHyperlinkElementUtils.hostname – это String, содержащий домен.

Синтаксис

string = object.hostname;
object.hostname = string;

Примеры

js
// Допустим, что документ содержит элемент <a id="myAnchor" href="https://developer.mozilla.org/ru/docs/HTMLHyperlinkElementUtils.hostname">
var anchor = document.getElementByID("myAnchor");
var result = anchor.hostname; // Вернёт: 'developer.mozilla.org'

Спецификации

Specification
HTML
# dom-hyperlink-hostname-dev

Совместимость с браузерами

Смотрите также

Help improve MDN

Learn how to contribute

This page was last modified on by MDN contributors.

AltStyle によって変換されたページ (->オリジナル) /