This is Javascript that is in the SVG file inside tags.
This SVG shows a timeline of bands in my city. When the mouse clicks on a , the script accesses an XML library a
Roberts code above works for me on IE11, Thanks Robert!.
At first I got Object doesn't support property or method 'createElementNS' but found this was due to compatibility mode being enabled on that page, once I removed it things worked fine.
In SVG elements must be created in the SVG namespace. This means that createElement won't create an SVG text element, you need createElementNS instead.
So
q = document.createElement("text");
should be
q = document.createElementNS("http://www.w3.org/2000/svg", "text");