<script type="text/javascript">
function add(){
var p1=document.getElementById("p1");
p1.className="one";
}
````
<p1>javascript</p1>
<input type="button" name="button" value="点击添加样式" onClick="add()"/>
<script type="text/javascript">
function cancel(){
var myChar=document.getElementById("p1");
p1.className="原来的类名字";
}
````
<p1>javascript</p1>
<input type="button" name="button" value="取消设置样式" onClick="cancel()"/>