含雪幸福

导航

 
</head>
<body>
<script>
window.onload=function(){
document.getElementById('click').onclick=function(){

if (document.getElementById('text').style.display=='none'){
document.getElementById('text').style.display='block';
}else{
document.getElementById('text').style.display='none';
}
}
}

</script>
<a id='click' href='###'>文字超链接</a>
<input type='text' style='display:none;' id='text' />
</body>
文本框下面可以加个按钮吗?
按钮跟输入框放在一个DIV里面啦

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
搜索<meta http-equiv="Content-Type" content="text/html; charset={dede:global.cfg_soft_lang/}" />
<title>Bom对象</title>

</head>

<body> 
    <script>
window.onload=function(){
   document.getElementById('click').onclick=function(){
              if (document.getElementById('text').style.display=='none'){
                               document.getElementById('text').style.display='block';
             }else{
                 document.getElementById('text').style.display='none';
              }       
           }
    }

</script>
<div  id='text'  style='display:none;' >
     <input type='text' />
          <input type='submit' value='提交'/>
</div>
    <a  id='click'  href='###'>文字超链接</a>
</body>
</html>
posted on 2015-02-23 20:55  含雪幸福  阅读(5173)  评论(0)    收藏  举报
 
/*生成博客目录的CSS*/ #uprightsideBar{ font-size:12px; font-family:Arial, Helvetica, sans-serif; text-align:left; position:fixed;/*将div的位置固定到距离top:50px,right:0px的位置,这样div就会处在最右边的位置,距离顶部50px*/ top:50px; right:0px; width: auto; height: auto; } #sideBarTab{ float:left; width:30px; border:1px solid #e5e5e5; border-right:none; text-align:center; background:#ffffff; } #sideBarContents{ float:left; overflow:auto; overflow-x:hidden;!important; width:200px; min-height:108px; max-height:460px; border:1px solid #e5e5e5; border-right:none; background:#ffffff; } #sideBarContents dl{ margin:0; padding:0; } #sideBarContents dt{ margin-top:5px; margin-left:5px; } #sideBarContents dd, dt { cursor: pointer; } #sideBarContents dd:hover, dt:hover { color:#A7995A; } #sideBarContents dd{ margin-left:20px; }