User:AdamJack

jQuery Selectors

$("#testbutton").click(function { // ** selector

});

** selector

$("div > p:last-child").css("background-color","red"); // children of div

$("div, strong, #testbutton").css("background-color","red"); // more then one element

$("div strong").css("background-color","red"); // all stronge descendants of div

$("div:even").css("background-color","red"); // odd / includes 0

$("#").css("background-color","red"); // id name - html

$(".class").css("background-color","red"); // class name - html

$("strong.class").css("background-color","red"); // all strong in class

$(this).css("background-color","red"); // key word / no "quotation marks"