Need some help at Js. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Need some help at Js.

I have cloned an element which itself has elements, now I want to change those element into other colors in the cloned element. How can I do so? Thanks for answering. https://code.sololearn.com/W6cTg2U5PRJg/?ref=app

19th Feb 2018, 5:31 AM
Isair Calhawk
Isair Calhawk - avatar
2 Answers
+ 3
Here's a solution: https://code.sololearn.com/WBhTCSRofRoA/?ref=app I used the parent element of the clone to change the background of each child nodes. Another solution for that is by adding class name to each child node instead of adding style directly in js incase you want to add additional styles to the clones.
19th Feb 2018, 6:13 AM
Jonathan Pizarra (JS Challenger)
Jonathan Pizarra (JS Challenger) - avatar
+ 2
Thanks a lot @Jonathan
19th Feb 2018, 6:15 AM
Isair Calhawk
Isair Calhawk - avatar