ITeye博客

html按钮有两种 button,div显示,

chokee · 2014-05-07 15:26 · html · Web前端 · Markdown

html按钮有两种: 和登录 这两种在页面上看起来好像一样没什么区别,但是这两种是有区别的。 1,如果在 标签中,使用,要想提交form, 你必须写成, 或者document.loginForm.submit();否则form是不会提交的。 2,如果在form中使用登录只要点击就会提交。 。 今天在使用时,我又在js控制表单提交,结果这个action总是莫名其妙的走两次! 根源就是表单提交了两次,一次是,一次是document.loginForm.submit(); 这个错误很隐蔽,大家以后要注意。 //////////////////////

    <a href="#" id="btn" iconCls="icon-search">easyui</a>    
    <a href="#" id="jin" class="easyui-linkbutton" >禁用</a>  
    <a href="#" id="qi" class="easyui-linkbutton">启用</a>  
    <!--  
    linkbutton的属性  
    id:分配给该组件的ID。  
    disabled:设置为true将禁用按钮。  
    plain:为true时不显示边框浮上去会显示边框,相反就是正常的样式,默认是false  
    text:按钮上显示的文字。  
    iconCls:用来在左边显示一个16x16大小图标的css类。  

    linkbutton的方法  
    disable:禁用按钮。  
    enable:启用按钮。  
    -->  

///////////////////// $("#hide").click(function(){ $("p").hide(); });

$("#show").click(function(){ $("p").show(); });

div的visibility可以控制div的显示和隐藏,但是隐藏后页面显示空白:   style="visibility: none;"   document.getElementById("typediv1").style.visibility="hidden";//隐藏   document.getElementById("typediv1").style.visibility="visible";//显示

  通过设置display属性可以使div隐藏后释放占用的页面空间,如下   style="display: none;"   document.getElementById("typediv1").style.display="none";//隐藏   document.getElementById("typediv1").style.display="";//显

//////////////// 刷新父页面 window.parent.location.reload();/

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。