jquery選取器中(:button)的含義

來源:互聯網
上載者:User

標籤:

   在有了javascript基礎後開始學習的jquery,水平很菜,但還是想把我日常學習中發現的一些之前不太理解的東西後來有了一些瞭解的東西寫出來與大家分享,如果有不對的地方也歡迎各位大神指正。

   jquery中選取器中(:button)在W3Cshcool中的解釋是【選取所有 type="button" 的 <input> 元素 和 <button> 元素】

   但在我的測試中,當button的type=submit的時候也一樣可以選擇出來。

   

<!DOCTYPE html>
<html>
<head>
<script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$("button").click(function(){
$(this).hide();
});
});
</script>
</head>
<body>
<button type="button">按鈕</button>
<button type="submit">提交</button>

</body>
</html>

 

jquery選取器中(:button)的含義

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.