<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD><BODY>
<P ID=oPara STYLE="color:green;">
This is the test paragraph.</P><BUTTON onclick="alert(oPara.style.cssText);oPara.style.cssText='color:red';">
Get CSS attributes</BUTTON></BODY>
</HTML>
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD><BODY>
<P ID=oPara STYLE="color:green;">
This is the test paragraph.</P><BUTTON onclick="alert(oPara.style.cssText);oPara.style.cssText='color:red';">
Get CSS attributes</BUTTON></BODY>
</HTML>
<input onclick="document.all.m.href='http://lucky.myrice.com/cssforv6/index.css'" value="change" type=button>
不过我还想
有没有能直接引入一个.css文件的方法呢?
<select onchange="document.styleSheets[0].href=this.options[this.selectedIndex].value+'.css'" id=select1 name=select1>
<option value="Style/new">默认风格</option>
<option value="Style/red">粉红风情</option>
<option value="Style/blue">蓝色港湾</option>
<option value="Style/black">灰暗忧郁</option>
</select>