MediaWiki:Common.js: Difference between revisions

From stencil.wiki
No edit summary
No edit summary
Line 1: Line 1:
/* Any JavaScript here will be loaded for all users on every page load. */
/* Any JavaScript here will be loaded for all users on every page load. */
document.addEventListener("DOMContentLoaded", function () {
document.addEventListener("DOMContentLoaded", function () {
     document.querySelectorAll("h2").forEach(function (header) {
     document.querySelectorAll("h2 > span.mw-headline").forEach(function (headline) {
         if (header.textContent.trim() === "Steps") {
         if (headline.textContent.trim() === "Steps") {
             header.style.color = "blue";
             headline.parentElement.style.color = "blue"; // Apply styles to the h2
         }
         }
     });
     });
});
});

Revision as of 01:28, 14 January 2025

/* Any JavaScript here will be loaded for all users on every page load. */
document.addEventListener("DOMContentLoaded", function () {
    document.querySelectorAll("h2 > span.mw-headline").forEach(function (headline) {
        if (headline.textContent.trim() === "Steps") {
            headline.parentElement.style.color = "blue"; // Apply styles to the h2
        }
    });
});