create id in Javascript site:w3schools.com code example
Example: javascript change element id
var element = document.getElementById("oldID");
element.id = "newID";
var element = document.getElementById("oldID");
element.id = "newID";