<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<script>
var lastBtn = null
function colorBtn(which){
if( lastBtn != null ){
lastBtn.style.background = "none" 
lastBtn.style.color = "black"
}
which.style.background = "blue"
which.style.color = "white"
lastBtn = which
}
</script>
<body>
<table width="120" border="1" cellspacing="0" cellpadding="2">
  <tr>
    <td onclick="colorBtn(this)">12312</td>
    <td onclick="colorBtn(this)">12312</td>
    <td onclick="colorBtn(this)">123</td>
  </tr>
  <tr>
    <td onclick="colorBtn(this)">12312</td>
    <td onclick="colorBtn(this)">12312</td>
    <td onclick="colorBtn(this)">123</td>
  </tr>
  <tr>
    <td onclick="colorBtn(this)">12312</td>
    <td onclick="colorBtn(this)">12312</td>
    <td onclick="colorBtn(this)">123</td>
  </tr>
</table></body>
</html>

解决方案 »

  1.   

    <tr>
    <td height="26" align="left" onclick="colorBtn(this)"><a href="logon.jsp" class="global_nav">网上交易</a></td></tr>
    (我想在页面上点击按钮后,把class="global_nav"变成class="global_nav2")
    这样怎么弄啊 
      

  2.   

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    </head>
    <Style>
    .global_nav{
    color:red;
    }
    .global_nav2{
    color:yellow;
    }
    </Style>
    <script>
    var lastBtn = null
    function colorBtn(which){
    if( lastBtn != null ){
    lastBtn.style.background = "none" 
    lastBtn.style.color = "black"

    lastLinks = lastBtn.all.tags("a")
    lastLinks[0].className = "global_nav"
    }
    which.style.background = "blue"
    which.style.color = "white"

    links = which.all.tags("a")
    links[0].className = "global_nav2"

    lastBtn = which
    }</script>
    <body>
    <table width="703" border="1" cellspacing="0" cellpadding="2">
    <tr>
    <td height="26" align="left" onclick="colorBtn(this)"><a href="logon.jsp" class="global_nav">网上交易</a>
    </td>
    </tr>
    <tr>
    <td height="26" align="left" onclick="colorBtn(this)"><a href="logon.jsp" class="global_nav">网上交易</a>
    </td>
    </tr></table>
    </body>
    </html>
      

  3.   

    <!-- content begin -->
    <script>
    var lastBtn = null
    function colorBtn(which){
    if( lastBtn != null )
    {


    lastLinks = lastBtn.all.tags("a")
    lastLinks[0].className = "global_nav"
    }
    links = which.all.tags("a")
    links[0].className = "global_nav2"

    lastBtn = which
    }
    <!--
    function MM_openBrWindow(url, title)
    { //v2.0
    window.open(url,title,"width=605,height=500,resizable=yes,scrollbars=yes,left="+(screen.width/2-300).toString()+",top="+(screen.height/2-250).toString()+"");
    }
    -->
    </script>
    <Style>
    .global_nav
    {
    font-size : 9pt;
    color: #868686;
    padding: 8px 0px 8px 15px;
    }
    .global_nav2
    {
    font-size: 9pt;
    color:#ff6600;
    padding: 8px 0px 8px 15px;

    }
    </Style>
    <table width="775" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <!-- left begin cedef7-->
    <td width="180" valign="top" bgcolor="#cedef7" height="400"><br>
    <table width="163" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
    <td colspan="2" rowspan="2" valign="top">
    <table width="160" border="0" cellpadding="0" cellspacing="1" bgcolor="#999999">
                <tr>
    <td valign="top" bgcolor="#FFFFFF">
    <table width="158" border=0 cellpadding=0 cellspacing=0>
    <tr>
    <td valign="top" bgcolor="#FFFFFF"><img src="images/3_til_1.gif" width="158" height="27"></td>
    </tr>
    <!-- first row left content begin -->
    <tr>
    <td align=center valign="middle" bgcolor="#FFFFFF">
    <table width="150" border="0" cellspacing="0" cellpadding="0">
    <tr class="normal">
    <td width="150">&nbsp;&raquo;&para;&Oacute;&shy;&Auml;ú&pound;&iexcl;</td>
    </tr>
    <tr class="normal">
    <td>&Ccedil;&euml;&Ntilde;&iexcl;&Ocirc;&ntilde;&Iuml;à&Oacute;&brvbar;&frac12;&raquo;&Ograve;×&sup1;&brvbar;&Auml;&Uuml;&pound;&iexcl;</td>
    </tr>
    </table>
    </td>
    </tr>
                    <tr>
    <td align=center valign="middle" bgcolor="#6373CE"><img src="images/spacer.gif" width="1" height="16"></td>
                    </tr>
    <!-- first row left content end -->
    <!-- left menu begin-->
    <tr>
    <td align=center valign="middle" bgcolor="#FFFFFF" class="normal">
    <table width="140" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
    <td height="8"></td>
    </tr>
    <tr>
    <td height="26" align="left" onclick="colorBtn(this)"><a href="open.jsp" class="global_nav">&Iacute;&oslash;&Eacute;&Iuml;&iquest;&ordf;&raquo;§</a></td>
    </tr>
    <tr>
    <td background="images/dashline_h_01.gif"><img src="images/spacer.gif" width="1" height="1"></td>
    </tr>
    <tr>
    <td height="26" align="left" onclick="colorBtn(this)"><a href="logon.jsp" class="global_nav">&Iacute;&oslash;&Eacute;&Iuml;&frac12;&raquo;&Ograve;×</a></td>
    </tr>
    <tr>
    <td background="images/dashline_h_01.gif"><img src="images/spacer.gif" width="1" height="1"></td>
    </tr>

                         <tr>
    <td>&nbsp;</td>
    </tr>
    </table>
    </td>
    </tr>
    <!-- left menu begin-->
    </table>
    </td>
    </tr>
                        <tr>
                            <td align="center" valign="middle" bgcolor="#FFFFFF" style="padding-top:3px;">
                               <a href="fundGuide.htm" target="blank"><img src="images/guide.gif"/></a>
                            </td>
                        </tr>
    </table>
    </td>
    <td width="3" height="3" valign="top" bgcolor="#E3E3E3"><img src="images/spacer_green.gif" width="3" height="3"></td>
    </tr>
    <tr>
    <td bgcolor="#E3E3E3"><img src="images/spacer.gif" width="3" height="3"></td>
    </tr>
    <tr>
    <td width="3" bgcolor="#E2EEC4"><img src="images/spacer.gif" width="3" height="3"></td>
    <td width="160" bgcolor="#E3E3E3"><img src="images/spacer.gif" width="3" height="3"></td>
    <td width="3" bgcolor="#E3E3E3"><img src="images/spacer.gif" width="3" height="3"></td>
    </tr>
    </table>
    <br>
    </td>
    <!-- left end --> <!-- right begin -->
    <td width="595" valign="top"  style="background-image: URL(bg.gif);">
    <br>
           <table width="595" border="0" cellspacing="0" cellpadding="0" >
    <tr>
    <td align="center"><table width="523" border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td colspan="2" rowspan="2" valign="top"><table width="520" border="0" cellpadding="0" cellspacing="1" bgcolor="#999999">
                      <tr>
                        <td valign="top" bgcolor="#FFFFFF"><img src="images/personal_main_head.gif" width="518" height="68"></td>
                      </tr>
                  </table></td>
                  <td width="3" height="3" valign="top" bgcolor="#E3E3E3"><img src="images/spacer_white.gif" width="3" height="3"></td>
                </tr>
                <tr>
                  <td bgcolor="#E3E3E3"><img src="images/spacer.gif" width="3" height="3"></td>
                </tr>
                <tr>
                  <td width="3" bgcolor="#FFFFFF"><img src="images/spacer.gif" width="3" height="3"></td>
                  <td width="517" align="left" bgcolor="#E3E3E3"><img src="images/spacer.gif" width="3" height="3"></td>
                  <td width="3" bgcolor="#E3E3E3"><img src="images/spacer.gif" width="3" height="3"></td>
                </tr>
              </table>
              <br>
    不行啊,怎么不能改变颜色的,到底是为什么呀
      

  4.   

    我的msn:[email protected]
    qq:48114558
    联系一下,请教一下
    谢谢,能留下你的联系方式么?