function calculateResult() { var numberInput = parseInt(document.getElementById("numberInput").value); var result = Module.ccall("myFunction", "number", ["number"], [numberInput]); document.getElementById("output").innerText = "Result: " + result; } // document // .getElementById("calculateBtn") // .addEventListener("click", calculateResult); function calculate() { var a = parseInt(document.getElementById("input1").value); var b = parseInt(document.getElementById("input2").value); var result = Module.ccall("add", "number", ["number", "number"], [a, b]); document.getElementById("result").innerText = "Result: " + result; }