jQuery元素的隱藏與顯示實(shí)例
更新時(shí)間:2015年01月20日 16:42:25 投稿:shichen2014
這篇文章主要介紹了jQuery元素的隱藏與顯示的方法,實(shí)例分析了hide與show的使用技巧,需要的朋友可以參考下
本文實(shí)例講述了jQuery元素的隱藏與顯示的方法。分享給大家供大家參考。具體實(shí)現(xiàn)方法如下:
復(fù)制代碼 代碼如下:
<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>
希望本文所述對(duì)大家的jQuery程序設(shè)計(jì)有所幫助。
相關(guān)文章
使用jQuery輕松實(shí)現(xiàn)Ajax的實(shí)例代碼
在Asp.Net的MVC架構(gòu)中使用jQuery是一件很容易的事情,而使用jQuery實(shí)現(xiàn)Ajax更加簡(jiǎn)單。2010-08-08jQuery 獲取除某指定對(duì)象外的其他對(duì)象 ( :not() 與.not())
這篇文章主要介紹了JQuery 獲取除某指定對(duì)象外的其他對(duì)象 ( :not() 與.not()),需要的朋友可以參考下2018-10-10jQuery獲取多種input值的簡(jiǎn)單實(shí)現(xiàn)方法
下面小編就為大家?guī)硪黄猨Query獲取多種input值的簡(jiǎn)單實(shí)現(xiàn)方法。小編覺得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧2016-06-06基于jQuery中ajax的相關(guān)方法匯總(必看篇)
下面小編就為大家?guī)硪黄诨趈Query中ajax的相關(guān)方法匯總。小編覺得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧2017-11-11