how to set id to created element in javascript code example
Example 1: add id to element javascript
myPara.setAttribute("id", "id_you_like");
Example 2: javascript change element id
var element = document.getElementById("oldID");
element.id = "newID";