MediaWiki:Common.js: Difference between revisions
Appearance
Replaced content with "→Any JavaScript here will be loaded for all users on every page load.: " Tag: Replaced |
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.querySelectorAll('.commentary-toggle').forEach(function (btn) { | |||
btn.addEventListener('click', function () { | |||
var id = btn.getAttribute('data-target'); | |||
var body = document.getElementById(id); | |||
if (!body) return; | |||
body.classList.toggle('commentary-hidden'); | |||
}); | |||
}); | |||
}); | |||
Revision as of 07:19, 24 March 2026
/* Any JavaScript here will be loaded for all users on every page load. */
document.addEventListener('DOMContentLoaded', function () {
document.querySelectorAll('.commentary-toggle').forEach(function (btn) {
btn.addEventListener('click', function () {
var id = btn.getAttribute('data-target');
var body = document.getElementById(id);
if (!body) return;
body.classList.toggle('commentary-hidden');
});
});
});