Created
July 27, 2021 01:22
-
-
Save psqq/d23a5c688564cf5a19dd1b2004ed6c0c to your computer and use it in GitHub Desktop.
This file contains 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
{ | |
name: 'Calculator', | |
run() { | |
document.body.innerHTML = ` | |
<input type="text"><br><br> | |
Result: <span></span> | |
`; | |
var result = document.querySelector('span'); | |
var input = document.querySelector('input'); | |
input.onkeyup = () => { | |
result.innerText = eval("(" + input.value + ")"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment