MediaWiki:Common.js: Difference between revisions

From softwear.directory
Jump to navigation Jump to search
No edit summary
Tag: Reverted
No edit summary
Tag: Reverted
Line 1: Line 1:
// Wait for the DOM to be ready
// Log a message to the console to check if JavaScript is working
document.addEventListener('DOMContentLoaded', function() {
console.log('JavaScript is working!');
    // Log a message to the console
    console.log('JavaScript is working!');
 
    // Find all elements with class "card"
    var cards = document.querySelectorAll('.card');
 
    // Convert the NodeList to an array for compatibility with older browsers
    var cardsArray = Array.prototype.slice.call(cards);
 
    // Log a message if cards are found
    if (cardsArray.length > 0) {
        console.log('Found all cards:', cardsArray);
    } else {
        console.log('No cards found.');
    }
});

Revision as of 11:14, 8 January 2024

// Log a message to the console to check if JavaScript is working
console.log('JavaScript is working!');