有两种方法:
1、预先定义一个CSS规则,然后用this.className=''".
2、用cssText,具体如下:
document.getElementById("dd").style.cssText="background-color:red;" ;
有两种方法:
1、预先定义一个CSS规则,然后用this.className=''".
2、用cssText,具体如下:
document.getElementById("dd").style.cssText="background-color:red;" ;