sebastiano.tronto.net

Source files and build scripts for my personal website
git clone https://git.tronto.net/sebastiano.tronto.net
Download | Log | Files | Refs | README

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