<pre test="testValue"></pre>NamedNodeMap: removeNamedItem() method / notebook
NamedNodeMap: removeNamedItem() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
const pre = document.querySelector("pre");
const attrMap = pre.attributes;
let result = `The 'test' attribute initially contains '${attrMap["test"].value}'.\n`;
result += "We remove it.\n\n";
attrMap.removeNamedItem("test");
result += attrMap.getNamedItem("test")
? "And 'test' still exists."
: "And 'test' is no more to be found.";
pre.textContent = result;