MediaWiki:Common.js: Difference between revisions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
document.addEventListener('DOMContentLoaded', function () { | document.addEventListener('DOMContentLoaded', function () { | ||
const closeButton = document.getElementById('sitenotice-close'); | |||
if (closeButton) { | if (closeButton) { | ||
closeButton.addEventListener('click', function () { | closeButton.addEventListener('click', function () { | ||
const banner = document.getElementById('sitenotice-banner'); | |||
if (banner) { | if (banner) { | ||
banner.style.display = 'none'; | banner.style.display = 'none'; // Hides the banner | ||
} | } | ||
}); | }); | ||
} | } | ||
}); | }); |
Revision as of 05:36, 17 November 2024
document.addEventListener('DOMContentLoaded', function () { const closeButton = document.getElementById('sitenotice-close'); if (closeButton) { closeButton.addEventListener('click', function () { const banner = document.getElementById('sitenotice-banner'); if (banner) { banner.style.display = 'none'; // Hides the banner } }); } });