Categories:
.NET (357)
C (330)
C++ (184)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (2)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How to change style on an element?
How to change style on an element?
✍: Guest
Between CSS and javascript is a weird symmetry. CSS style rules are layed 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";
2009-02-03, 4510👍, 0💬
Popular Posts:
How can we know the number of days between two given dates in PHP? Simple arithmetic: <?php $...
Can you explain why your project needed XML? Remember XML was meant to exchange data between two ent...
How do I use a scriptlet to initialize a newly instantiated bean? A jsp:useBean action may optionall...
What will be printed as the result of the operation below: main() { int x=5; printf("%d,%d,%d\n",x,x. ..
How does multi-threading take place on a computer with a single CPU? The operating system's task sch...