Download the JQuery library from Jquery.com. They archive different versions and provide a compressed (or minified) version and an un-compressed version. You can download the latest compressed version from the JQuery home page and it will work with all of the examples. Move this file into the directory where you will be working.
You can obviously place the jquery js file anywhere, as long as you provide the correct path to the file in your HTML document.
JQuery is very easy to use. Follow these steps:
- Import the JQuery js file with the script tag
At this point you can use JQuery in your scripts. Notice, your scripts come second.
Many times you will want to wait for your document to load before applying your own JS. This important, because executing JS before the elements it acts on are loaded will cause your scripts to fail. JQuery provides the ready() event to easily work around this.
To set up the ready event use the following: