Skip to content

Instantly share code, notes, and snippets.

@nwtgck
Created January 11, 2020 10:57
Show Gist options
  • Save nwtgck/b38321b22419d444a302ce9ce801d360 to your computer and use it in GitHub Desktop.
Save nwtgck/b38321b22419d444a302ce9ce801d360 to your computer and use it in GitHub Desktop.
<input id="myinput">
<script>
const r = Math.random();
window.myinput.value = r;
console.log(r);
</script>
@nwtgck
Copy link
Author

nwtgck commented Jan 11, 2020

Data URI version:
data:text/html,%3Cinput%20id%3D%22myinput%22%3E%0A%3Cscript%3E%0Aconst%20r%20%3D%20Math.random()%3B%0Awindow.myinput.value%20%3D%20r%3B%0Aconsole.log(r)%3B%0A%3C%2Fscript%3E

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment