Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <button type="button" onclick="myFunction1()" id="Coin">CLick ME</button>
- <script>
- function myFunction1() {
- var x = Math.floor(Math.random() * 2);
- console.log(x);
- if (x == 0) {
- document.getElementById("Coin").innerHTML = "HEADS";
- } else {
- document.getElementById("Coin").innerHTML = "TAILS";
- }
- }
- myFunction1();
- </script>
Advertisement
Add Comment
Please, Sign In to add comment