4,554
edits
No edit summary Tag: Manual revert |
No edit summary |
||
Line 585: | Line 585: | ||
window.location.href = '/Main_Page'; // Redirects to the home page | window.location.href = '/Main_Page'; // Redirects to the home page | ||
}); | }); | ||
function filterCards(entityValue, typeValue) { | |||
$('.card').each(function() { | |||
// Using jQuery to find the entity and type within the current card | |||
var entityText = $(this).find('.entity').text().trim(); | |||
var typeText = $(this).find('.type').text().trim(); | |||
// Logging the values to the console for debugging | |||
console.log(`Card entity: ${entityText}, Card type: ${typeText}`); | |||
// Check if the card matches both the entity and type filters | |||
if (entityText === entityValue && typeText === typeValue) { | |||
$(this).show(); // Show the card if it matches | |||
} else { | |||
$(this).hide(); // Hide the card if it doesn't match | |||
} | |||
}); | |||
} | |||
// Example usage: filter cards by 'Collective' entity and 'Image' type | |||
filterCards('Collective', 'Image'); | |||
}); | }); |