HTMLAreaElement: thuộc tính href

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

Thuộc tính href của giao diện HTMLAreaElement là một stringifier trả về chuỗi chứa toàn bộ URL và cho phép cập nhật href.

Nó phản ánh thuộc tính href của phần tử <area>.

Giá trị

Một chuỗi.

Ví dụ

js
// A <area id="myArea" href="https://mdn.go-mizu.dev/en-US/HTMLAreaElement"> element is in the document
const area = document.getElementById("myArea");
area.href; // returns 'https://mdn.go-mizu.dev/en-US/HTMLAreaElement'

Đặc tả kỹ thuật

Specification
HTML
# dom-hyperlink-href-dev

Tương thích trình duyệt

Xem thêm