MediaWiki:Common.js: Difference between revisions
From WikiMSK
No edit summary |
No edit summary |
||
Line 7: | Line 7: | ||
const headings = document.querySelectorAll('.mw-parser-output h2'); | const headings = document.querySelectorAll('.mw-parser-output h2'); | ||
headings.forEach(element => console.log(element)); | headings.forEach(element => console.log(element))); | ||
}); | }); |
Revision as of 08:24, 22 August 2020
/* Any JavaScript here will be loaded for all users on every page load. */
$(document).ready(function() {
// Get all the <h2> headings
const headings = document.querySelectorAll('.mw-parser-output h2');
headings.forEach(element => console.log(element)));
});
$(document).ready(function(){
const headings = document.querySelectorAll('.mw-parser-output h2');
console.log(headings);
});