Difference between revisions of "MediaWiki:Common.js"

From UCGO-WIKI
Jump to navigation Jump to search
Line 3: Line 3:
 
var myElement = document.getElementById('mw-mywiki-example');
 
var myElement = document.getElementById('mw-mywiki-example');
 
console.log('test wiki js');
 
console.log('test wiki js');
myElement.innerHTML = 'any HTML';
+
myElement.innerHTML = 'Click Me';
 
myElement.onclick = function(){alert('hi');}
 
myElement.onclick = function(){alert('hi');}
 
}());
 
}());

Revision as of 03:29, 15 April 2020

/* Any JavaScript here will be loaded for all users on every page load. */
$(function () {
	var myElement = document.getElementById('mw-mywiki-example');
	console.log('test wiki js');
	myElement.innerHTML = 'Click Me';
	myElement.onclick = function(){alert('hi');}
}());