조회 : 649
function test(){ let icnt = 0 , t, table; t = performance.now() document.querySelectorAll("#sot2 > table > * > tr >td,#sot2 > table > * > tr >th").forEach((td, i) => { icnt+=td.colSpan; }); ; console.log('time',performance.now()-t,icnt); icnt = 0; t = performance.now() table = document.querySelector("#sot2 > table"); for(const tr of table.rows){ for(const td of tr.cells){ icnt+=td.colSpan; } } console.log('time',performance.now()-t,icnt); }