Widget:年表標籤/篩選
JavaScript腳本:
window.addEventListener('load', function() {
document.querySelectorAll('.filter').forEach(function(ele) {
ele.addEventListener('click', function() {
document.querySelectorAll('#mw-content-text dl').forEach(function(parent) {
var child = parent.querySelector('dd > :not(.mw-collapsed)');
if(child)
parent.style.display = '';
else
parent.style.display = 'none';
});
});
});
});
//