script.js (456B)
1 import SumLibrary from "./sum_library.mjs"; 2 3 var sumLibraryInstance = await SumLibrary(); 4 5 var aInput = document.getElementById("aInput"); 6 var bInput = document.getElementById("bInput"); 7 var button = document.getElementById("goButton"); 8 var resultText = document.getElementById("resultText"); 9 10 button.addEventListener("click", () => { 11 var a = Number(aInput.value); 12 var b = Number(bInput.value); 13 resultText.innerText = sumLibraryInstance._sum(a, b); 14 });