From what I’ve found, JS quite enjoyable and JQuery even more so as it reduces the code I need to write to get things done (at the expense of the initial learning).
I’ve got a long way to go but here is a minimalistic list I’ve made for myself of various Selectors and filtering on those selectors.
$allListItems = $("li"); $alldivs = $("div"); $whodom = $("*"); $byclass = $(".someclass"); $byId = $("#Id");
$all_li_in_fancylist = $("li" .fancylist");
– Descendant of class/id etc constraint
= All items that are a descendants of list items that have a class of fancylist
$(".shiny > a")
-Ancestor > child type
= All links that are a child of an element with a class of shiny
= Will select all list-elements that are the first child of their parent.
$alldivs = $("div"); $lastdiv = $alldivs.last(); $2nddiv = $alldivs.eq(1);