Basic Flow of a jQuery Application

Contact Us or call 1-877-932-8228
Basic Flow of a jQuery Application

Basic Flow of a jQuery Application

Most jQuery applications will follow a sequence of steps like:

  1. Locate one or more page elements according to some criteria.
  2. Perform some action(s) on those elements:
    • Modify CSS
    • Modify HTML
    • Add event handlers
    • Etc.
  3. Repeat 1 and 2 as necessary.

The first section of this chapter deals with making selections. Since we need to affect our selections somehow in order to see what was actually selected, we will limit ourselves to using the addClass(className) method on our selections at first. Later in the chapter we will explore some of the many functions jQuery provides to modify selected elements.