MediaWiki:Common.js: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 1: Line 1:
// Wait for the DOM to be ready
document.addEventListener('DOMContentLoaded', function() {
    // Get all elements with class "card"
    var cards = document.querySelectorAll('.card');
    // Attach click event listener to each card
    cards.forEach(function(card) {
        card.addEventListener('click', function() {
            // Extract entry number from the clicked card
            var entryNumber = this.querySelector('.entry-number').textContent;
            // Call openModal with the entry number
            openModal(entryNumber);
        });
    });
});
function openModal(entryNumber) {
function openModal(entryNumber) {
     // You can replace this with your logic to fetch and display data
     // You can replace this with your logic to fetch and display data

Navigation menu