<div class="codetitle"> <span><a style="CURSOR: pointer" data="83687" class="copybut" id="copybut83687" onclick="doCopy('code83687')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code83687"> <br>//element:需要添加新样式的元素,value:新的样式 <br>function addClass(element, value ){ <br>if (!element.className){ <br>element.className = value; <br>}else { <br>newClassName = element.className; <br>newClassName+= " "; <br>newClassName+= value ; <br>element.className = newClassName; <br>} <br>} <br> </div>