michael1026
Member
Code:
var whichFunction = function() {
if((document.getElementById('five').checked) && (document.getElementById('tutorial').checked)) {
both();
} else if(document.getElementById('five').checked) {
five();
} else if(document.getElementById('tutorial').checked) {
tutorial();
} else {
justHungry();
}
};
var tutorial = function(randomNumber) {
var randomNumber = Math.floor(Math.random() * 8 + 1);
switch (randomNumber) {
*Snip* Just cases
}
};
var both = function() {
var randomNumber = Math.floor(Math.random() * 11 + 1);
switch (randomNumber) {
//*Snip* Just cases
}
};
var five = function() {
var randomNumber = Math.floor(Math.random() * 10 + 1);
switch (randomNumber) {
//*Snip* Just cases
}
};
var justHungry = function() {
var randomNumber = Math.floor(Math.random() * 6 + 1);
switch (randomNumber) {
// *snip* Just cases
}
};
</script>
</head>
<body>
<div class="body">
<h1>Random Chooser</h1>
<p>
<p>
<button onclick="whichFunction()" id="button">Choose For Me!!</button>
<p><input type="checkbox" value="tutorial" name="tutorial" id="tutorial"></p>
<p><input type="checkbox" name="five" value="five" id="five"></p>
</p>
</p>
</div>
</body>
</html>
This used to work, then I started messing with the button, and I'm not sure what I did. I removed some text and CSS that wasn't important. But the problem is that the button won't run any functions. I even put a simple thing like Prompt(0); inside of the functions, but still won't do anything. I can post the page if needed. Thanks.