MediaWiki:Zerospace EN.js: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
function | function generate_alien() | ||
{ | { | ||
var random_alien = ''; | var random_alien = ''; | ||
Line 5: | Line 5: | ||
random_alien = Math.floor((Math.random() * dice_size) + 1); | random_alien = Math.floor((Math.random() * dice_size) + 1); | ||
document.getElementById(" | document.getElementById("random_alien_output").innerHTML = 'Your Random Alien'; | ||
document.getElementById("random_alien_output").innerHTML = random_alien; | |||
alert("Test!"); | alert("Test!"); | ||
Line 12: | Line 13: | ||
$(function () { | $(function () { | ||
var random_alien_title = document.getElementById('random_alien_title'); | |||
var random_alien_button = document.getElementById('random_alien_button'); | |||
random_alien_title.innerHTML = 'Create An Alien'; | |||
random_alien_button.innerHTML = '<input type="button" value="Generate An Alien" onclick="generate_alien();" />'; | |||
}()); | }()); |
Revision as of 14:15, 25 April 2018
function generate_alien()
{
var random_alien = '';
var dice_size = 6;
random_alien = Math.floor((Math.random() * dice_size) + 1);
document.getElementById("random_alien_output").innerHTML = 'Your Random Alien';
document.getElementById("random_alien_output").innerHTML = random_alien;
alert("Test!");
}
$(function () {
var random_alien_title = document.getElementById('random_alien_title');
var random_alien_button = document.getElementById('random_alien_button');
random_alien_title.innerHTML = 'Create An Alien';
random_alien_button.innerHTML = '<input type="button" value="Generate An Alien" onclick="generate_alien();" />';
}());