const svg = document.querySelector("svg");
const nonce = svg.nonce || svg.getAttribute("nonce");
// Modern browsers hide the nonce attribute from getAttribute()
console.log(nonce); // Prefer using `svg.nonce`SVGElement: nonce property / notebook
SVGElement: nonce property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.