MediaWiki:Common.js: Difference between revisions
| IssuePress (talk | contribs) No edit summary | IssuePress (talk | contribs)  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 ( |      document.querySelectorAll("h2 > span.mw-headline").forEach(function (headline) { | ||
|          if ( |          if (headline.textContent.trim() === "Steps") { | ||
|              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
        }
    });
});