If I create the SVG within HTML and give the text items I want to change IDs, I have no problem accessing the ID using
let callQSO = document.getElementById("QSOcall").value; and then writing that to the SVG with
document.getElementById("SVGcallQSO").innerHTML = callQSO;
However for various reasons I want the SVG to be an external file, outside of HTML.
So I load the SVG file as an object
Then try to get the elements of the object from within JS with
let svgObject = document.getElementById('svg-object').contentDocument; from the console I can see this returns a null.
Can anyone offer any suggestion that would mean I can read the elelments from the external svg and manipulate them?
As always, grateful for any help.
I suspect I have a syntax problem somewhere, but where?