<math>
<mrow>
<mi>f</mi>
<mo stretchy="false">(</mo>
<mi id="el" style="border-top: 1px solid blue; color: red;">x</mi>
<mo stretchy="false">)</mo>
<mo>=</mo>
<mi>x</mi>
</mrow>
</math>
<div id="output"></div>MathMLElement: attributeStyleMap property / notebook
MathMLElement: attributeStyleMap property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
#el {
font-size: 16px;
}
#output {
white-space: pre-line;
}const element = document.getElementById("el");
const output = document.getElementById("output");
for (const property of element.attributeStyleMap) {
output.textContent += `${property[0]} = ${property[1][0].toString()}\n`;
}