var newlabel = document.createElement("Label"); newlabel.setAttribute("for",id_from_input); newlabel.innerHTML = "Here goes the text"; parentDiv.appendChild(newlabel);