<script>
let buttons = document.querySelectorAll('.hack4-filter-button');
// Event listener for each button
buttons.forEach(function (button) {
button.addEventListener('click', function (e) {
// Prevent the default button behavior
e.preventDefault();
// Get the anchor value from a data attribute
let url = 'https://www.straygoat.co.uk/blog#' + this.getAttribute('data-anchor');
// Navigate to the URL
window.location.href = url;
});
});
</script>