Tuesday, May 20, 2014

Basic JQuery Filters

Using Basic JQuery Filters
This is in the notes that i found from a video. To filter use below code,a dd it with your selection.

Filter Purpose
:first Select only the first instance
:last Select only the last instance
:even Select only even-numbered
:odd Select only the odd-numbered
:eq(n) Filters out elements that are not positioned at the given index
:gt(n) Includes elements that are past before the given index
:lt(n) Includes elements (H1,H2,H3,etc)
:animated Selects all elements that are currently being animated in some way.
:not(selector) Includes elements that do not match the given selector


For Example :
$("document").ready(function(){
   $("p:first").css("border", "3px solid red");
});

*p is for paragraph selected