Book Image

Learning Website Development with Django

Book Image

Learning Website Development with Django

Overview of this book

Table of Contents (18 chapters)
Learning Website Development with Django
Credits
About the Author
About the Reviewers
Preface
Index

The jQuery JavaScript Framework


jQuery is a library of JavaScript functions that facilitates interacting with HTML documents and manipulating them. The library is designed to reduce the time and effort spent on writing code and achieving cross-browser compatibility, while at the same time taking full advantage of what JavaScript offers to build interactive and responsive web applications.

The general workflow of using jQuery consists of two steps:

  1. Select an HTML element or a group of elements to work on

  2. Apply a jQuery method to the selected group

Element Selectors

jQuery provides a simple approach to select elements; it works by passing a CSS selector string to a function called $. Here are some examples to illustrate the usage of this function:

  • If you want to select all anchor (<a>) elements on a page, you can use the following function call: $("a")

  • If you want to select anchor elements which have the .title CSS class, use $("a.title")

  • To select an element whose ID is #nav, you can use...