标签:
0 | even |
1 | odd |
2 | even |
3 | odd |
4 | even |
$("tr:even").addClass('even')
table tr.even { background: #CCC; }
0 | even |
1 | odd |
2 | even |
3 | odd |
4 | even |
$('ul li').filter(':first');
:animated
$('div:animated'); // #1 $('div:not(div:animated').animate({height:100}); // #2
var myElem = $('#elem'); if (myElem.is(':animated')) { // do something }
<span>Hello Bob!</span>JS
$(‘span:contains("Bob")); # contains參数区分大写和小写,能够不需冒号
$(‘div:has(p a)‘);
$(‘div:not(#content))
$(‘a:not(div.important a, a.nav)‘);
var anchors = $(‘a‘); anchors.click(function() { anchors.not(this).addClass(‘not-clicked‘); });
if ($(‘#elem‘).is(‘:hidden‘)) { // Do something conditionally } $(‘p:visible‘).hide();
$(‘a[href="http://google.com"]‘);
$(‘*[title][href]‘)
jQuery selector syntax | Selects what? |
:text | <input type="text" /> |
:password | <input type="password" /> |
:radio | <input type="radio" /> |
:checkbox | <input type="checkbox" /> |
:submit | <input type="submit" /> |
:image | <input type="image" /> |
:reset | <input type="reset" /> |
:button | <input type="button" /> |
:file | <input type="file" /> |
:hidden | <input type="hidden" /> |
版权声明:本文博主原创文章,博客,未经同意不得转载。
标签:
原文地址:http://www.cnblogs.com/lcchuguo/p/4823287.html