How Do You Run the ENTIRE Javascript Page From An Button In HTML?
<p>I have been trying to make all my Javascript Page code from JSBin to work automatically upon the clicking of a button. Problems include not being able to run the code because it says I have multiple variables in my script that do not work together and not being able to put it all in HTML because console.log doesn't work. I tried a couple different ideas, but sadly, I am unable to do it correctly.</p>

<p>My Code Is:</p>

<pre><code>var name = prompt('So what is your name?');

var confirmName = confirm('So your name is ' + UCFL(name) + '?');

function UCFL(string) {
return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase();
}

if (confirmName === true) {
var start = confirm('Good. Lets start the roleplay, Sir ' + UCFL(name) + '. Are you  
ready?');
}
if (confirmName === false) {
var name = prompt('Than what is your name?');
var confirmNamed = confirm('So your name is ' + UCFL(name) + '?');
}

if (confirmNamed === true) {
var start = confirm('Good. Lets start the roleplay, Sir ' + UCFL(name) + '. Are you    
ready?');
}
if (confirmNamed === false) {
var name = prompt('Than what is your name?');
var confirmName = confirm('So your name is ' + UCFL(name) + '?');
if (confirmName === true) {
var start = confirm('Good. Lets start the roleplay, Sir ' + UCFL(name) + '. Are you
ready?');
}
if (confirmName === false) {
alert('Oh, guess what? I do not even fucking care what your name is anymore. Lets just 
start..');
var start = confirm('Are you ready?');
}
}

if (start === true) {
var x = console.log(Math.floor(Math.random() * 5));
if (x === 1) {
    alert('You are an dwarf in a time of great  disease.');
    alert('');
}

}
</code></pre>

<p>And this is what I want you to fix: </p>

<pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;

&lt;head&gt;
&lt;meta charset=utf-8 /&gt;
&lt;title&gt;JS Bin&lt;/title&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;form&gt;
&lt;input type="button" value="Start The Game" onclick="" /&gt;
&lt;/form&gt;
&lt;/body&gt;

&lt;/html&gt;
</code></pre>
