In web page display, sometimes some CSS attributes need to be dynamically changed. You can only change individual attributes in CSS, such as character sets, or change the full set of CSS attributes. There are already many similar themes. CodeInstance. Here is a brief summary.
1. The style attribute of an object can be used only to change individual attributes, such as style. fontfamily.
Note that only the first character after the "-" line in CSS needs to be capitalized: font-family fontfamily. vs2008 is alreadyProgramPersonnel should be prepared. Specifically, the floaters are style.stylefloatits other style.css float.
2. If there are multiple schemes in the same CSS file and the scheme is class, you can modify the class attribute of the DOM object, such:
VaR olddiv = Document. getelementsbyid (divid );
Olddiv. classname = "newclassname ";
3. To change the CSS file, you need to change the href attribute under the link tag.
For example, <link href = "songti.css" id = "divcss" rel = "stylesheet" type = "text/CSS"/> change its href.
......
VaR newcss = Document. getelementsbyid (divcss );
Newcss. href = "new.css ";
......