Код: Выделить всё
function highlightDuplicates(tableId) {
const table = document.getElementById(tableId);
const cells = table.getElementsByTagName("td");
const values = {};
for (let i = 0; i < cells.length; i++) {
const cell = cells[i];
const cellValue = cell.textContent.trim();
if (values[cellValue]) {
cell.style.backgroundColor = 'black';
cell.style.color = 'white';
} else {
values[cellValue] = true;
}
}
}
highlightDuplicates('myTable');
Подробнее здесь: https://stackoverflow.com/questions/794 ... html-table
Мобильная версия