MediaWiki:Zerospace EN.js: Difference between revisions

From OGC
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
function generate_alien_type()
{
alien_type = 'Exotic alien';
return alien_type;
}
function generate_alien()
function generate_alien()
{
{
var random_alien = '';
var random_alien = '';


random_alien = 'boofus';
random_alien = generate_alien_type();
document.getElementById("random_alien_title").innerHTML = 'Your Random Alien';
document.getElementById("random_alien_title").innerHTML = 'Your Random Alien';
document.getElementById("random_alien_output").innerHTML = random_alien;
document.getElementById("random_alien_output").innerHTML = random_alien;

Revision as of 15:01, 25 April 2018

function generate_alien_type()
{
	alien_type = 'Exotic alien';
	return alien_type;
}

function generate_alien()
{
	var random_alien = '';

	random_alien = generate_alien_type();
	document.getElementById("random_alien_title").innerHTML = 'Your Random Alien';
	document.getElementById("random_alien_output").innerHTML = random_alien;
}

$(function () {
	var random_alien_title = document.getElementById('random_alien_title');
	var random_alien_button = document.getElementById('random_alien_button');

	random_alien_title.innerHTML = 'Randomly Generate An Alien';
	random_alien_button.innerHTML = '<input type="button" value="Generate An Alien" onclick="generate_alien();" />';
}());