create element ns svg

JavaScript
document.createElementNS("http://www.w3.org/2000/svg","yourelement")
Source

Also in JavaScript: