MediaWiki:Common.js
Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
- Opera: Press Ctrl-F5.
/* Any JavaScript here will be loaded for all users on every page load. */ let test = document.getElementById("test"); // This handler will be executed only once when the cursor // moves over the unordered list test.addEventListener("mouseenter", function( event ) { // highlight the mouseenter target event.target.style.color = "white"; // reset the color after a short delay setTimeout(function() { event.target.style.color = ""; }, 500); }, false); // This handler will be executed every time the cursor // is moved over a different list item test.addEventListener("mouseover", function( event ) { // highlight the mouseover target event.target.style.color = "black"; // reset the color after a short delay setTimeout(function() { event.target.style.color = ""; }, 500); }, false);