User:Sur/common.js: Difference between revisions
< User:Sur
Created page with "// Wait for the document to be ready mw.hook('wikipage.content').add(function ($content) { // Check if the input box exists on the page if (document.getElementById('userInputBox')) { // Function to update the variable function updateVariable() { var inputValue = document.getElementById('userInputBox').value; // Make an API call to update the page variable new mw.Api().postWithToken('csrf', {..." |
mNo edit summary |
||
Line 1: | Line 1: | ||
document.addEventListener('DOMContentLoaded', function() { | |||
const statBoxes = document.querySelectorAll('.stat-box'); | |||
statBoxes.forEach(function(statBox) { | |||
statBox.addEventListener('click', function() { | |||
statBox.classList.toggle('clicked'); | |||
}); | |||
} | }); | ||
} | |||
}); | }); |