.querySelector()
only returns the first matching element.
Use .querySelectorAll()
, which will return an array of all matching elements. You'll then have to iterate through the array.
let trs = document.querySelectorAll('tr'); //**** <- note "All" added
trs.forEach(tr => console.log(tr.firstElementChild));
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…