How to change style on an element?
Submitted by: AdministratorBetween CSS and JavaScript is a weird symmetry. CSS style rules are laid on top of the DOM. The CSS property names like "font-weight" are transliterated into "myElement.style.fontWeight". The class of an element can be swapped out. For example:
document.getElementById("myText").style.color = "green";
document.getElementById("myText").style.fontSize = "20";
-or-
document.getElementById("myText").className = "regular";
Submitted by: Administrator
document.getElementById("myText").style.color = "green";
document.getElementById("myText").style.fontSize = "20";
-or-
document.getElementById("myText").className = "regular";
Submitted by: Administrator
Read Online JavaScript Job Interview Questions And Answers
Top JavaScript Questions
☺ | To write messages to the screen without using "document.write()"? |
☺ | What's Math Constants and Functions using JavaScript? |
☺ | How to make a array as a stack using JavaScript? |
☺ | How is JavaScript different from Java? |
☺ | How to setting a cookie with the contents of a textbox? |
Top Top World Wide Web Categories
☺ | Cascading Style Sheet CSS Interview Questions. |
☺ | HTML5 Interview Questions. |
☺ | Basic Internet Interview Questions. |
☺ | Domain Name System (DNS) Interview Questions. |
☺ | JavaScript Interview Questions. |