A help using styles | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

A help using styles

I want to change the color of all header's child tag by using JS and deleting the text-decoration from all links from a ul by using JS too... Any one can tell me how I can do it? I don't want to use css directly(I could, but not)... https://code.sololearn.com/W7XJTxVx6LU9/?ref=app

10th Jan 2022, 1:36 AM
Marco Cárdenas
Marco Cárdenas - avatar
1 Answer
+ 2
U can use document.querySelectorAll() for CSS selector example : selecting all child inside div div > * for header : var header = document.querySelectorAll("header") console.log(header) header.forEach(header =>{ header.style.color = "green " }) //} Do same with anchor
10th Jan 2022, 3:00 AM
Pariket Thakur
Pariket Thakur - avatar