jquery中:input和input的區(qū)別分析
更新時間:2011年07月13日 23:35:12 作者:
:input表示選擇表單中的input,select,textarea,button元素,input僅僅選擇input元素。
復(fù)制代碼 代碼如下:
<script type="text/javascript">
$(function(){
$(":input").focus(function(){
$(this).addClass("focus");
}).blur(function(){
$(this).removeClass("focus");
});
})//這個效果第三個textarea也會添加樣式
</script>
<form action="" method="post" id="regForm">
<fieldset>
<legend>個人基本信息</legend>
<div>
<label for="username">名稱:</label>
<input id="username" type="text" />
</div>
<div>
<label for="pass">密碼:</label>
<input id="pass" type="password" />
</div>
<div>
<label for="msg">詳細信息:</label>
<textarea id="msg" rows="2" cols="20"></textarea>
</div>
</fieldset>
</form>
相關(guān)文章
防止jQuery ajax Load使用緩存的方法小結(jié)
本篇文章主要是對防止jQuery ajax Load使用緩存的方法進行了介紹,需要的朋友可以過來參考下,希望對大家有所幫助2014-02-02jQuery插件FusionWidgets實現(xiàn)的Cylinder圖效果示例【附demo源碼】
這篇文章主要介紹了jQuery插件FusionWidgets實現(xiàn)的Cylinder圖效果,結(jié)合實例形式分析了jQuery使用FusionWidgets結(jié)合swf文件讀取xml數(shù)據(jù)并采用Cylinder圖展示的相關(guān)實現(xiàn)技巧,并附帶demo源碼供讀者下載參考,需要的朋友可以參考下2017-03-03jQuery 2.0.3 源碼分析之core(一)整體架構(gòu)
這篇文章主要介紹了jQuery 2.0.3 源碼分析之core(一)整體架構(gòu),需要的朋友可以參考下2014-05-05