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

7 months ago
  1. function calculateResult() {
  2. var numberInput = parseInt(document.getElementById("numberInput").value);
  3. var result = Module.ccall("myFunction", "number", ["number"], [numberInput]);
  4. document.getElementById("output").innerText = "Result: " + result;
  5. }
  6. // document
  7. // .getElementById("calculateBtn")
  8. // .addEventListener("click", calculateResult);
  9. function calculate() {
  10. var a = parseInt(document.getElementById("input1").value);
  11. var b = parseInt(document.getElementById("input2").value);
  12. var result = Module.ccall("add", "number", ["number", "number"], [a, b]);
  13. document.getElementById("result").innerText = "Result: " + result;
  14. }