get element by id javascript and get the name of the new element code example
Example 1: get element by id in javascript
document.getElementById("YourElementId");
Example 2: javascript change element id
var element = document.getElementById("oldID");
element.id = "newID";