我是靠谱客的博主 冷酷紫菜,这篇文章主要介绍jQuery元素的隐藏与显示实例,现在分享给大家,希望可以做个参考。

本文实例讲述了jQuery元素的隐藏与显示的方法。分享给大家供大家参考。具体实现方法如下:

复制代码 代码如下:

<html xmlns="http://www.w3.org/1999/xhtml"> 
<head runat="server"> 
    <title></title> 
    <script type="text/jscript" src="jquery/jquery-1.10.2.js"></script> 
    <script type="text/javascript"> 
        $(document).ready(function () { 
            $("#but1").click(function () { 
                $("#tex1").hide(); 
            }); 
        }) 
        $(document).ready(function () { 
            $("#but2").click(function () { 
                $("#tex1").show(); 
            }); 
        })     
    </script> 
</head> 
<body> 
    <form id="form1" runat="server"> 
    <div> 
    <input type="button" value="客户端隐藏"  onclick="document.getElementById('tex1').style.display='none'" /> 
    <input type="button" value="客户端显示"  onclick="document.getElementById('tex1').style.display='inline'" /> 
    <input type="button" value="$客户端隐藏" id="but1" /> 
    <input type="button" value="$客户端显示" id="but2" /> 
    <input type="text" id="tex1" /> 
    </div> 
    </form> 
</body> 
</html>

希望本文所述对大家的jQuery程序设计有所帮助。

最后

以上就是冷酷紫菜最近收集整理的关于jQuery元素的隐藏与显示实例的全部内容,更多相关jQuery元素内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(252)

评论列表共有 0 条评论

立即
投稿
返回
顶部