add id to element javascript

JavaScript
myPara.setAttribute("id", "id_you_like");Element.setAttribute(name, value);
Source

Also in JavaScript: