Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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')


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: