Class PPT
Agenda
jQuery
- jQuery is a fast, small, and feature-rich JavaScript library.
- It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
- It is a lightweight, "write less, do more", JavaScript library.
- With a combination of versatility and extensibility, jQuery has changed the way that millions of people write JavaScript.
- The jQuery library contains the following features:
- HTML/DOM manipulation
- CSS manipulation
- HTML event methods
- Effects and animations
- AJAX
Adding jQuery
- The jQuery library is a single JavaScript file, and you reference it with the HTML
<script>
tag.
- Make sure that the script tag should be inside the head section.
Basic Syntax
$(selector).action()
$
sign to define/access jQuery
(selector)
to "query (or find)" HTML elements
action()
to be performed on the element(s)
Example
$(this).hide()
- hides the current element.