javascript change element id

JavaScript
var element = document.getElementById("oldID");
element.id = "newID";
Source

Also in JavaScript: