Last Class Review

DOM

  • Document Object Model

  • Browsers views HTML pages as documents and provides developers with a means of programatically referencing HTML pages using Javascript


What is jQuery?

  • A Javascript library that allows developers to manipulate the DOM using CSS selectors

  • jQuery provides an alternative (more intuitive) way of referencing the DOM (HTML elements) so we can add behavior to our pages


  // selecting an element using native/pure javascript
  document.getElementById('flavors');

vs


  // using jQuery (same as above but with much more intuitive syntax)
  $('#flavors');

Anything that can be done in jQuery can be done with native Javascript, just with less code


What jQuery Isn’t

  • jQuery isn’t another programming language (it’s Javascript)