MediaWiki:Common.js: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
Tag: Reverted
No edit summary
Tag: Reverted
Line 6: Line 6:
     // Find all elements with class "card"
     // Find all elements with class "card"
     var cards = document.querySelectorAll('.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
     // Log a message if cards are found
     if (cards.length > 0) {
     if (cardsArray.length > 0) {
         console.log('Found all cards:', cards);
         console.log('Found all cards:', cardsArray);
     } else {
     } else {
         console.log('No cards found.');
         console.log('No cards found.');
     }
     }
});
});

Navigation menu