- HTML/DOM manipulation
- CSS manipulation
- HTML event methods
- Effects and animations
Adding jQuery to Your Web Pages
There are several ways to start using jQuery on your web site. You can:
- Production version – this is for your live website because it has been minified and compressed
- Development version – this is for testing and development (uncompressed and readable code)
The jQuery syntax is tailor-made for selecting HTML elements and performing some action on the element(s). Basic syntax is: $(selector).action()
- A $ sign to define/access jQuery
- A (selector) to “query (or find)” HTML elements
- A jQuery action() to be performed on the element(s)
- $(this).hide() – hides the current element.
- $(“p”).hide() – hides all <p> elements.
- $(“.test”).hide() – hides all elements with class=”test”.
- $(“#test”).hide() – hides the element with id=”test”
Floating point numbers are also stored in a platform-specific range. They can be specified using floating point notation, or two forms of scientific notation.
PHP has a native Boolean type that is similar to the native Boolean types in Java and C++.
The null data type represents a variable that has no value; NULL is the only allowed value for this data type.
Arrays can contain elements of any type that PHP can handle, including resources, objects, and even other arrays
jQuery Event Methods
All the different visitor’s actions that a web page can respond to are called events. An event represents the precise moment when something happens. Examples:
- moving a mouse over an element
- selecting a radio button
- clicking on an element
The term “fires/fired” is often used with events. Example: “The keypress event is fired, the moment you press a key”.
jQuery Syntax For Event Methods :
In jQuery, most DOM events have an equivalent jQuery method. To assign a click event to all paragraphs on a page, you can do this:
The next step is to define what should happen when the event fires. You must pass a function to the event:
Commonly Used jQuery Event Methods
The $(document).ready() method allows us to execute a function when the document is fully loaded.