<div>
<svg viewBox="0 0 120 30" xmlns="http://www.w3.org/2000/svg">
<text x="20" y="20" id="user" data-id="1234567890" data-user="carinaanand">
Carina Anand
</text>
</svg>
</div>SVGElement: dataset property / notebook
SVGElement: dataset property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
const el = document.querySelector("#user");
console.log(el.dataset.id); // "1234567890"