From 2a8e7aeeef99161b6f0378ac14e297c23ca6227b Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Wed, 4 Jun 2025 11:55:34 +0200 Subject: First 4 examples --- 02_library_modularized/script.mjs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 02_library_modularized/script.mjs (limited to '02_library_modularized/script.mjs') diff --git a/02_library_modularized/script.mjs b/02_library_modularized/script.mjs new file mode 100644 index 0000000..bac26d4 --- /dev/null +++ b/02_library_modularized/script.mjs @@ -0,0 +1,14 @@ +import MyLibrary from "./build/library.mjs"; + +var myLibraryInstance = await MyLibrary(); + +var aInput = document.getElementById("aInput"); +var bInput = document.getElementById("bInput"); +var button = document.getElementById("goButton"); +var resultText = document.getElementById("resultText"); + +button.addEventListener("click", () => { + var a = Number(aInput.value); + var b = Number(bInput.value); + resultText.innerText = myLibraryInstance._multiply(a, b); +}); -- cgit v1.3