diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2025-06-04 11:55:34 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2025-06-04 11:55:34 +0200 |
| commit | 2a8e7aeeef99161b6f0378ac14e297c23ca6227b (patch) | |
| tree | d3ab195eabf4d06cad8b305756e14d4b138eae63 /01_library/script.js | |
| download | emscripten-tutorial-2a8e7aeeef99161b6f0378ac14e297c23ca6227b.tar.gz emscripten-tutorial-2a8e7aeeef99161b6f0378ac14e297c23ca6227b.zip | |
First 4 examples
Diffstat (limited to '')
| -rw-r--r-- | 01_library/script.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/01_library/script.js b/01_library/script.js new file mode 100644 index 0000000..9432402 --- /dev/null +++ b/01_library/script.js | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | var aInput = document.getElementById("aInput"); | ||
| 2 | var bInput = document.getElementById("bInput"); | ||
| 3 | var button = document.getElementById("goButton"); | ||
| 4 | var resultText = document.getElementById("resultText"); | ||
| 5 | |||
| 6 | button.addEventListener("click", () => { | ||
| 7 | var a = Number(aInput.value); | ||
| 8 | var b = Number(bInput.value); | ||
| 9 | resultText.innerText = Module._multiply(a, b); | ||
| 10 | }); | ||
