Last active
November 5, 2022 05:50
-
-
Save vegerot/2ac3932a603a630b62de4a869bece443 to your computer and use it in GitHub Desktop.
JavaScript Playground
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
<html> | |
<body> | |
<code> | |
<script type="module" contenteditable> | |
console.log("hello, world!"); | |
const script = document.querySelector("script"); | |
script.addEventListener("input", function runScript(e) { | |
eval(e.target.innerHTML); | |
script.removeEventListener("input", runScript); | |
}); | |
</script> | |
<style contenteditable> | |
script, | |
style { | |
display: block; | |
white-space: pre; | |
} | |
</style> | |
</code> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment