Cut And Paste Code For Lesson 9
This page is still under construction, check back later!

This week we learn how to create random numbers and events:


<!DOCTYPE html>
<p>I'm thinking of a number between 1 and 100.</p>
<p>What is your guess?</p>
<button onclick="myFunction()">Click Here To Enter Your Number</button>
<button onclick="myFunction2()">My number was:
<p id="demo"></p>

function myFunction() {

    var person = prompt("Enter your guess, if you dare!", "");
    if (person != null) {
        document.getElementById("demo").innerHTML =
        "How could you have thought " + person + "?   I was thinking:";
function myFunction2() {
    var x = document.getElementById("demo")
    x.innerHTML = Math.floor((Math.random() * 100) + 1);