const commandAction = document.getElementById("command-action"); const addButton = document.getElementById("add-command"); const rmButton = document.getElementById("remove-command"); function lastCommandId() { let list = document.querySelectorAll("div.command h2"); return parseInt(list[list.length-1].innerText.replace("Command ", "")); } addButton.addEventListener("click", () => { let id = lastCommandId() + 1; commandAction.insertAdjacentHTML("beforebegin", `