This page uses JQuery to handle click events. When you click either of the links below, an alert box pops up.
If you recall, in a previous example, we used the "onclick" attribute of an XHTML tag to detect the onclick events without JQuery.
This technique using JQuery is better because it does not require any changes to the XHTML code - all the behaviors are coded in Javascript, which means the code responsible for behaviors is clearly separated from the markup code. Plus, the syntax is more standardized than the default Javascript way of doing things in Javascript, which is usually totally inconsistent.