MediaWiki:Zerospace EN.js: Difference between revisions

From OGC
Jump to navigation Jump to search
No edit summary
No edit summary
Line 15: Line 15:
     '</script>';
     '</script>';


   generateOutput.innerHTML = '<input type="button" value="GO 2" onclick="alert("I am an alert box!");" />';
   generateOutput.innerHTML = '<input type="button" value="GO 2" onclick="alert(\"I am an alert box!\");" />';


}());
}());

Revision as of 13:30, 25 April 2018

$(function () {

  var generateButton = document.getElementById('generate_alien_button');
  var generateOutput = document.getElementById('generate_alien_output');

  generateButton.innerHTML = '<input type="button" value="GO 1" onclick="get_alien();" />' +
    '<script type="application/javascript">' +
    'function get_alien()' +
    '{' +
    '  alert("I am an alert box!");' + 
    '}' +
    '</script>';

  generateOutput.innerHTML = '<input type="button" value="GO 2" onclick="alert(\"I am an alert box!\");" />';

}());