日期:2014-05-16  浏览次数:20403 次

如何做这个按钮
页面的STYLE如下
<style>
.nt   {font:bolder   9pt   tahoma;padding:13px;border-bottom:1px   solid   black}
.nc   {font:7pt   tahoma;padding:5px;border-bottom:1px   solid   #cccccc;   vertical-align:top}
.nc_on   {font:bolder   9pt   tahoma;padding:border-bottom:1px   solid   ;width:13px;background-color:whitesmoke}
td   {text-align:center;}
.lc   {font:bolder   9pt   tahoma;text-align:left;}
.rc   {font:bolder   9pt   tahoma;text-align:right;   color:aaaaaa;bolder:0px}
.nc2   {font:8pt   tahoma;border-bottom:1px   solid;color:red}
.terminal   {text-align:left;width:550px;font-size:9pt;font-family:Courier   New;font-weight:bold;   text-overflow   :   ellipsis;   overflow   :   hidden   }
</style>
想做个按钮,按一下可以将overflow   :   hidden   变成空值,再按一下,可以恢复,这个应该如何做呢?
刚学JavaScript,请多指教

------解决方案--------------------
<style>
.style1{overflow:hidden}
</style>
<div class=style1 style= "width:100px " id=div1> asdfasdfasdfasdfasdfasdfasdasfasdfasdfasdf </div>
<input type=button onclick= "document.getElementById( 'div1 ').className=document.getElementById( 'div1 ').className== 'style1 '? ' ': 'style1 ' " value=change />