Difference between revisions of "MediaWiki:Common.js"
Jump to navigation
Jump to search
Line 3: | Line 3: | ||
(function () | (function () | ||
{ | { | ||
var | var calculatorBody = document.getElementById('mw-time-calculator'); | ||
if ( | if (calculatorBody) | ||
{ | { | ||
var msgElement = document.createElement(' | var msgElement = document.createElement('div'); | ||
var | var timeEarth = document.createElement('input'); | ||
timeEarth.setAttribute("type", "number"); | |||
timeEarth.setAttribute("name", "mv-time-earth"); | |||
timeEarth.setAttribute("placeholder", "0"); | |||
var msgText = document.createTextNode('Hello world'); | |||
msgElement.appendChild( | msgElement.appendChild(timeEarth); | ||
calculatorBody.appendChild(msgElement); | |||
} | } | ||
}()); | }()); |
Revision as of 03:48, 11 December 2022
/* Any JavaScript here will be loaded for all users on every page load. */ (function () { var calculatorBody = document.getElementById('mw-time-calculator'); if (calculatorBody) { var msgElement = document.createElement('div'); var timeEarth = document.createElement('input'); timeEarth.setAttribute("type", "number"); timeEarth.setAttribute("name", "mv-time-earth"); timeEarth.setAttribute("placeholder", "0"); var msgText = document.createTextNode('Hello world'); msgElement.appendChild(timeEarth); calculatorBody.appendChild(msgElement); } }());