This might help you:
- Math.random() not math it's case sensitive
- $('#yourButton').click(function(){}) from DA. (This is useful)
- onclick="www.nu.nl" will not work if you want you can add
- 0.5 is a number in JS not 0,5
- There is soo small chance to win because 0.6187859538476914 :D number = number.toFixed(1);
- 1 represent decimal places
<Br> doesnt need to be closed
- And something a lot useful is F12 in Chrome and Console tab
user181796 have a nice rest of day!
JS
$('#Start').click(function(){
number = Math.random();
number = number.toFixed(1);
if (number < 0.5) {
console.log("you lost " + number);
} else {
console.log("you win " + number);
}
});
Head
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
Html
<span> text box 1 </span>
<input class = "styleYellow" type = "text"> </input>
<br> <br>
<span> text box 1 </span><input type = "text"> </input>
<br> </br>
<button id="Start">Ga naar pagina 1</button>
<button id="I_dont_know">Ga naar pagina 2</button>
minMath!