function gallery() {
// Get all elements with an id attribute
let elements = document.querySelectorAll('[id]');
// Loop over them
for (let element of elements) {
// Get the value of the href attribute
let href = element.href;
// Add an event listener to each element
element.addEventListener('click', function(event) {
// Prevent the default action
event.preventDefault();
// Check if the href includes 'html'
if (href.includes('html')) {
// NEW open href without history
window.location.replace(href);}
});}
}