<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<script language="JavaScript" type="text/javascript">
 function z_show(ok)
 {
    document.all("txt1").style.visibility='hidden'
    document.all("txt2").style.visibility='hidden'
    document.all("txt"+ok).style.visibility='visible'
 }
</script>
</head><body>
<form name="form1" method="post" action="">
  <input name="txt1" type="text" id="txt1" style="visibility: hidden" value="文本框A">
  <input name="txt2" type="text" id="txt2" style="visibility: hidden" value="文本框B">
  <br>
  <input type="button" name="cmd1" value="显示文本框A" onClick="javascript:z_show('1')">
  <input type="button" name="cmd2" value="显示文本框B" onclick="javascript:z_show('2')">
</form>
</body>
</html>

解决方案 »

  1.   

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>无标题文档</title>
    <script language="JavaScript" type="text/javascript">
     function z_show(ok)
     {
        document.all("txt1").style.display='none'
        document.all("txt2").style.display='none'
        document.all("txt"+ok).style.display='block'
     }
    </script>
    </head><body>
    <form name="form1" method="post" action="">
      <input name="txt1" type="text" id="txt1" style="display: none" value="文本框A">
      <input name="txt2" type="text" id="txt2" style="display: none" value="文本框B">
      <br>
      <input type="button" name="cmd1" value="显示文本框A" onClick="javascript:z_show('1')">
      <input type="button" name="cmd2" value="显示文本框B" onclick="javascript:z_show('2')">
    </form>
    </body>
    </html>
      

  2.   

    发表时间:  2004-1-29 14:39:25 
                ~~~~~~~~~~~~~~~~~~
     zhangshici(我是谁) ( ) 信誉:100  2004-1-29 14:39:55  
                                       ~~~~~~~~~~~~~~~~~~