-
How can styles or classes be changed in elements using JavaScript? |
Beta Was this translation helpful? Give feedback.
Answered by
Bunny77K9
Jun 18, 2022
Replies: 1 comment
-
JavaScript can be used to easily modify classes and styles in an element by making use of the following syntax: Modify styles: document.getElementById(“input”).style.fontSize = “10”; Next up on this top Web Development interview questions and answers blog, let us take a look at the advanced set of questions. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
DuajDiaz
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
JavaScript can be used to easily modify classes and styles in an element by making use of the following syntax:
Modify styles: document.getElementById(“input”).style.fontSize = “10”;
Modify class: document.getElementById(“button”).className = “classname”;
Next up on this top Web Development interview questions and answers blog, let us take a look at the advanced set of questions.