Is it possible to apply the same style to multiple elements at the same time? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

Is it possible to apply the same style to multiple elements at the same time?

document.(body, container, text).style.backgroundColor = colors[rdmClrInt]; Note: container and text are predefined variables with the value of their respective elements

16th May 2020, 6:21 PM
Sajid
Sajid - avatar
4 Respostas
+ 2
Sajid Yes using class attribute
16th May 2020, 6:29 PM
AĶ¢J
AĶ¢J - avatar
+ 4
Sajid You can give same class to multiple elements and by using jQuery you can apply CSS.
16th May 2020, 6:38 PM
AĶ¢J
AĶ¢J - avatar
+ 2
AJ #Infinity Love ohh right. That totally slipped out of my mind. Thanks
16th May 2020, 6:39 PM
Sajid
Sajid - avatar
+ 1
AJ #Infinity Love couldn't get you.
16th May 2020, 6:31 PM
Sajid
Sajid - avatar