Skip to navigation
Access an objected embedded SVG with JavaScript and fill and element with red color
10.08.23
Example of the embedded SVG Object ```html
``` Example of the JavaScript what changed its style element ```javascript const svg = document.querySelector('#th_keyboard').contentDocument; let svg2 = svg.getElementById('K_kb2c'); svg2.setAttributeNS(null,"fill","red") ```
https://petercollingridge.co.uk/tutorials/svg/interactive/javascript/
Reply
Anonymous
Information Epoch 1742193567
Data dominates.
Home
Notebook
Contact us