How to add or remove style of an element? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 8

How to add or remove style of an element?

Please Explain.

20th Oct 2019, 12:00 PM
Absolute Zero ϟ
Absolute Zero ϟ - avatar
1 Answer
+ 4
Just like this. To set document.getElementById(element Id).style.color = colorName; To remove document.getElementById(element Id).style.color = ''; By using javascript :- https://www.w3schools.com/jsref/prop_html_style.asp By using jQuery:- https://www.w3schools.com/jquery/jquery_css.asp
20th Oct 2019, 12:03 PM
A͢J
A͢J - avatar