Created
April 30, 2021 19:54
-
-
Save ericpkatz/c3b106149a53c7033e68e0cb3e5ca0f3 to your computer and use it in GitHub Desktop.
// source https://jsbin.com/xiveney
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
body { | |
color: red; | |
} | |
</style> | |
</head> | |
<body> | |
<h1>Hello World</h1> | |
<ul> | |
</ul> | |
<script id="jsbin-javascript"> | |
const ul = document.querySelector('ul'); | |
document.querySelector('h1').addEventListener('click', (ev)=> { | |
const rnd = Math.random(); | |
ev.target.innerText = rnd | |
const el = document.createElement('li'); | |
el.innerText = rnd; | |
ul.append(el); | |
}) | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">const ul = document.querySelector('ul'); | |
document.querySelector('h1').addEventListener('click', (ev)=> { | |
const rnd = Math.random(); | |
ev.target.innerText = rnd | |
const el = document.createElement('li'); | |
el.innerText = rnd; | |
ul.append(el); | |
})</script></body> | |
</html> |
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
body { | |
color: red; | |
} |
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
const ul = document.querySelector('ul'); | |
document.querySelector('h1').addEventListener('click', (ev)=> { | |
const rnd = Math.random(); | |
ev.target.innerText = rnd | |
const el = document.createElement('li'); | |
el.innerText = rnd; | |
ul.append(el); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment