ramsey

html 单击事件 隐藏/显示div

JS语言

    <script type="text/javascript">

        function display(id){
            var traget=document.getElementById(id);
            if(traget.style.display=="none"){
                traget.style.display="";
            }else{
                traget.style.display="none";
          } 
       }
    </script>

  

HTML

<input type="submit" value="在线支付" onclick="display(\'lb\')">
<div id="lb" style="display:none">
	<font>div属性:style ="display:none" 默认隐藏div</font>
</div>

  

posted on 2020-11-20 16:44  Arron_Ramsey  阅读(1195)  评论(0编辑  收藏  举报
 

分类:

技术点:

相关文章:

  • 2021-11-25
  • 2021-12-23
  • 2021-12-24
  • 2021-06-14
  • 2022-01-29
  • 2021-09-01
  • 2021-12-15
  • 2022-02-11
猜你喜欢
  • 2021-12-04
  • 2021-12-18
  • 2021-09-04
  • 2022-02-09
  • 2021-11-02
  • 2021-11-05
  • 2021-12-27
相关资源
相似解决方案