logo
logo

Apply Styles to Class

Beginner

Apply Styles to Class

Write a function that takes two parameters: a class name and a style object. The function should apply the styles to all elements on the page with the specified class. For example, if the function is called with the class name "foo" and the style object { color: "red", backgroundColor: "blue" }, it should apply those styles to all elements on the page with the class "foo".

Console
Submit
Solution
00:00