<a id="exampleLink" href="https://example.com" type="text/html">Example Link</a>
<p class="type"></p>HTMLAnchorElement: type property / notebook
HTMLAnchorElement: type property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
#exampleLink {
font-size: 1.5rem;
}const anchorElement = document.getElementById("exampleLink");
const pTag = document.querySelector(".type");
console.log(anchorElement.type); // Output: "text/html"
pTag.textContent = anchorElement.type;