jquery 学习(1)

来源:互联网 发布:网络转换器移动转电信 编辑:程序博客网 时间:2024/04/26 19:09

jQuery('*')

var elementCount = $("*").css("border","3px solid red").length;
$("body").prepend("<h3>" + elementCount + " elements found</h3>");

var elementCount = $("#test").find("*").css("border","3px solid red").length;
$("body").prepend("<h3>" + elementCount + " elements found</h3>");



jQuery(':animated')

 

$("#run").click(function(){

      $("div:animated").toggleClass("colored");
});
function animateIt() {
$("#mover").slideToggle("slow", animateIt);
}
animateIt();

jQuery('[attribute]')

jQuery('[attribute=value]')

jQuery('[attribute!=value]')

jQuery('[attribute^=value]')

jQuery('[attribute$=value]')

jQuery('[attribute*=value]')

jQuery('[attribute~=value]')

 

 

 

jQuery(':button')

jQuery(':checkbox')

jQuery(':checked')

 

 

 

jQuery('parent > child')

jQuery('.class')

jQuery(':contains(text)')

jQuery('ancestor descendant')

jQuery(':disabled')

jQuery('element')

jQuery(':empty')

jQuery(':enabled')

jQuery(':eq(index)')

jQuery('#id')

jQuery(':image')

jQuery(':input')

jQuery(':last-child')

jQuery(':last')

jQuery(':lt(index)')

jQuery('[attributeFilter1][attributeFilter2][attributeFilterN]')

jQuery('selector1, selector2, selectorN')

jQuery('prev + next')

jQuery('prev ~ siblings')

jQuery(':not(selector)')

jQuery(':nth-child(index/even/odd/equation)')

jQuery(':odd')

jQuery(':only-child')

jQuery(':parent')

jQuery(':password')

jQuery(':radio')

jQuery(':reset')

jQuery(':selected')

jQuery(':submit')

jQuery(':text')

jQuery(':visible')