Files
vintagecoding.net/js/clickable_rows.js
T
2025-03-31 12:06:01 -06:00

16 lines
532 B
JavaScript

document.addEventListener('DOMContentLoaded', function() {
const rows = document.querySelectorAll('tbody tr');
rows.forEach(row => {
row.addEventListener('click', function(event) {
// Check if the clicked element is within the non-clickable cell
if (event.target.closest('.excluded_cell')) {
return; // Do nothing if clicked inside the non-clickable cell
}
// Perform the desired action (e.g., redirect)
window.location.href = this.dataset.href; // Example redirect
});
});
});