how to add an id when creating an element code example Example: add id to element javascript myPara.setAttribute("id", "id_you_like");