jQuery Essentials

Selector Examples $(

pdftohtml jQuery Essentialsv2 by Marc Grabanski
We needed a hero to get these guys in line
jQuery rescues us by working the same in all browsers!
Easier to write jQuery than pure JavaScript
Hide divs with pure JavaScript divs = document.getElementByTagName(`div’); for (i = 0; i < divs.length; i++) { divs[i].style.display = `none'; }
Hide divs with pure JavaScript divs = document.getElementByTagName(`div’); for (i = 0; i < divs.length; i++) { divs[i].style.display = `none'; } Hide divs with jQuery $("div").hide();
HTML is tied to JavaScript
jQuery Philosophy
jQuery Philosophy #1. Find some HTML
jQuery Philosophy #1. Find some HTML #2. Do something to it
Find $(“div”)
Find let’s find some $(“div”) elements
Give $() a selector
Give $() a selector $(“#myId”)
Give $() a selector $(“#myId”) $(“.myClass”)
Give $() a selector $(“#myId”) $(“.myClass”) $(“table”)
Selector Examples $(“#content”) get element with id content
Selector Examples $(“#content”) get element with id content $(“li:first”) get first list item
Selector Examples $(“#content”) get element with id content $(“li:first”) get first list item $(“tr:odd”) get odd numbered table rows
Selector Examples $(“#content”) get element with id content $(“li:first”) get first list item $(“tr:odd”) get odd numbered table rows $(“a[target=_blank]“) get all links who’s target is “_blank”

Download jQuery Essentials pdf from marcgrabanski.com, 115 pages, 10081090KB.
Related Books

Leave a Reply