jQuery元素的隱藏與顯示實例
更新時間:2015年01月20日 16:42:25 投稿:shichen2014
這篇文章主要介紹了jQuery元素的隱藏與顯示的方法,實例分析了hide與show的使用技巧,需要的朋友可以參考下
本文實例講述了jQuery元素的隱藏與顯示的方法。分享給大家供大家參考。具體實現(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>
希望本文所述對大家的jQuery程序設(shè)計有所幫助。
相關(guān)文章
jquery上傳插件fineuploader上傳文件使用方法(jquery圖片上傳插件)
這篇文章主要介紹了jquery插件fineuploader上傳文件很用方法2013-12-12
jQuery實現(xiàn)對象轉(zhuǎn)為url參數(shù)的方法
這篇文章主要介紹了jQuery實現(xiàn)對象轉(zhuǎn)為url參數(shù)的方法,涉及jQuery針對字符串的遍歷與轉(zhuǎn)換操作相關(guān)技巧,需要的朋友可以參考下2017-01-01
利用jqprint插件打印頁面內(nèi)容的實現(xiàn)方法
qprint是一個基于jquery編寫的頁面打印的一個小插件,但是不得不承認這個插件確實很厲害,下面這篇文章主要給大家介紹了關(guān)于利用jqprint插件如何打印頁面內(nèi)容的實現(xiàn)方法,需要的朋友可以參考借鑒,下面隨著小編來一起學習學習吧。2018-01-01

