const addStringButton = document.getElementById("add-string-button"); addStringButton.addEventListener("click", (e) => { const stringName = prompt("Enter a string name: "); if (stringName == "") { return; } for (let section of document.getElementsByClassName("translation-section")) { // const lang = section.getAttribute("data-lang"); // // //
const label = document.createElement("label"); label.setAttribute("for", stringName); label.innerText = stringName; const input = document.createElement("input"); input.setAttribute("type", "text"); input.setAttribute("id", stringName); input.setAttribute("name", stringName); input.setAttribute("value", ""); const br = document.createElement("br"); section.appendChild(label); section.appendChild(input); section.appendChild(br); } });