I tried onclick function on the intSubmit
but for some reason when the code is executed the onclick is called once and when you press the button it does nothing. I tried using "debug()" but that, as I figured, doesn't work at all.
if(qType === "INTEGER"){
let intAnswer = document.createElement("input");
intAnswer.type = "text";
intAnswer.id = "intA";
let intSubmit = document.createElement("input");
intSubmit.type = "button";
intSubmit.onclick = debug();
intSubmit.value = "Submit";
qDiv.appendChild(intAnswer);
qDiv.appendChild(intSubmit);
}