2 ms·
I do a lot of fiddling around in the console for things like these, and the advent of ES2016 for..of loops makes this quite a lot simpler nowadays: for (let
by jffry 10y ago
I do a lot of fiddling around in the console for things like these, and the advent of ES2016 for..of loops makes this quite a lot simpler nowadays:
for (let a of document.querySelectorAll('a')) { a.style.fontWeight = 'normal' }
Alternatively, you can use the more functional:
Array.from(document.querySelectorAll('a')).map(a => a.style.fontWeight = 'bold')
If your browser supports the spread operator you could equivalently do:
[...document.querySelectorAll('a')].map(a => a.style.fontWeight = 'bold')