Last active
June 3, 2025 13:21
-
-
Save Kamilius/be302c5753296c73c9003677400d6389 to your computer and use it in GitHub Desktop.
The example Calculator app for the TechMagic "Efficient Debugging with DevTools" MagicJS Meetup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Efficient Debugging with DevTools. MagicJS</title> | |
</head> | |
<body> | |
<h1>Efficient Debugging with DevTools. MagicJS</h1> | |
<input id="num1" type="text" placeholder="First number"> | |
<input id="num2" type="text" placeholder="Second number"> | |
<button onclick="handleClick()">Calculate</button> | |
<p id="result">Result: </p> | |
<script> | |
function calculateSum(a, b) { | |
return a + b; | |
} | |
function handleClick() { | |
const num1Input$ = document.getElementById('num1'); | |
const num2Input$ = document.getElementById('num2'); | |
const num1 = parseInt(num1Input$.value); | |
const num2 = parseInt(num2Input$.value); | |
const result = calculateSum(num1, num2); | |
document.getElementById('result').textContent = `Result: ${result}`; | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment