const anchors = document.getElementsByTagName("a");
for (const anchor of anchors) {
const list = anchor.relList;
console.log(
`New anchor node found with ${list.length} link types in relList.`,
);
list.forEach((relValue) => {
console.log(relValue);
});
}HTMLAnchorElement: relList property / notebook
HTMLAnchorElement: relList property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.