Using Basic Selectors

jQuery library includes sizzle, uses CSS selectors to easily select DOM elements.

jQuery or $ is the jquery object, I avoid $, it can cause collisions, using noConflict; syntax for object is jQuery( selector ).chainedMethod.

method css( property name ) or css( property name, property value ) or css( { property name: property value, ... } )
Color Review, #rrggbb, or #rgb or CSS3 Color Name

Table 1.1 Basic Selectors Examples

HTML Core attributes

 

Example basic_html5.html

- can download zip from author site. ...

  1. Extract zip files and
  2. Select extraction folder user DW Replace src="../inc/jquery-1.7.2.js" with exact src in this file src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"
  3. Open chap-1/1.1.html - verify jQuery object exists
  4. We will be using 1.11.3 instead of 1.7.2 note I use the exact same src link throughout entire faculty site, why?
  5. Can use text book tutorials to create files.
  6. Analyze file

Tips

Combining selectors

Applying Filters to Selectors

Basic Filters

Basic Contains Filters

Use Filter Extension Method

:even and :odd filters, nth-child( 2n )

First row is Index 0, its on even row 0,1,2
Book example - 1.6.html - highlight odd rows
Can use
or CSS selector
nth-child starts at 1 not 0
nth-child( 1 ) is first row;
reset table back to black

Atrribute Selector -

Rewind - Review