how would i add an attribute to the “testTwo” tag?
Javascript noob..
var XML = document.createElement("test");
var Node = document.createElement("testOne");
Node.setAttribute("id", "0");
Node.setAttribute("random", "0");
Node.appendChild( document.createElement("testTwo"));
XML.appendChild(Node);
console.log(XML.innerHTML);
Create
testTwonode beforehand. Example code would be :