From 33c964211668d61495e77c5b7a9006d7a3dbeda7 Mon Sep 17 00:00:00 2001 From: Fredrik Jonsson Date: Mon, 24 Apr 2023 14:25:36 +0200 Subject: [PATCH] Remove use of :has() from js as well. --- assets/js/tables.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/js/tables.js b/assets/js/tables.js index 91af4bd..282c248 100644 --- a/assets/js/tables.js +++ b/assets/js/tables.js @@ -12,10 +12,11 @@ tables.forEach(function (table) { const headers = table.querySelectorAll('th'); - const rows = table.querySelectorAll('tr:has(td)'); + const rows = table.querySelectorAll('tbody tr'); rows.forEach(function (row) { const cells = row.querySelectorAll('td'); + cells.forEach(function (cell, i) { cell.setAttribute('role','cell'); if (headers[i].innerText) { @@ -25,5 +26,4 @@ }); }); - })();