You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

16 lines
649 B

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;
}