cookie不一定保险,如果用户不能使用cookie或者cookie被清除了,还是会变成老样子的。

解决方案 »

  1.   

    可能是我的描述不够准确吧这样的:
    我又一个按钮,像word中的居中那一类的,
    当我按下居中的按钮,让它陷下去,再按一下,又变会原来
      

  2.   

    <style>
    .up{border:2 solid black;border-top:2 solid white;border-left:2 solid white}
    .down{border:2 solid white;border-top:2 solid black;border-left:2 solid black}
    </style>
    <button class=up onclick="this.className=(this.className=='up')?'down':'up'">This?</button>
      

  3.   

    <style>
    .up{border-top:2 solid white;border-left:2 solid white;border-right:2 solid black;border-bottom:2 solid black;}
    .down{border-top:2 solid black;border-left:2 solid black;border-right:2 solid white;border-bottom:2 solid white;}
    </style>
    <input name=a1 type=button value=center onclick="this.className=this.className=='down'?'up':'down'" class=up>