A RetroSearch Logo

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

Search Query:

Showing content from https://developer.cdn.mozilla.net/en-US/docs/Web/API/HTMLBaseElement/href below:

HTMLBaseElement: href property - Web APIs

HTMLBaseElement: href property

Baseline Widely available

The href property of the HTMLBaseElement interface contains a string that is the URL to use as the base for relative URLs.

It reflects the href attribute of the <base> element.

Value

A string that contains a URL, or the empty string ("") if the corresponding <base> element does not include the href attribute.

Examples HTML with base URL

This example demonstrates that the href attribute in <base> is reflected in the href property of HTMLBaseElement.

const logElement = document.querySelector("#log");
function log(text) {
  logElement.innerText = text;
}
HTML
<base href="https://developer.mozilla.org/example" />
JavaScript
const base = document.getElementsByTagName("base")[0];
log(`base.href="${base.href}"`);
Result Specifications Browser compatibility

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