JQuery Library-Features
JQuery is a library of JavaScript functions.
The JQuery library contains the following features:
- HTML element Selection
- HTML element manipulation
- CSS actions
- HTML Event functions
- JavaScript Effects and animations
- HTML DOM Traversal and modification
- Ajax
- Utilities
Document-Ready functions
You may have noticed that all jQuery functions in our instance are in a document ready function:
$ (document). Ready (function () {---jQuery functions go----});
This is to prevent the document from running JQuery code before it is fully loaded (ready).
If you run the function before the document is fully loaded, the operation may fail. Here are two specific examples:
- Trying to hide an element that doesn't exist
- Get the size of an image that is not fully loaded
Get Content-text (), HTML (), and Val ()
Three simple and practical jQuery methods for DOM manipulation:
- Text ()-Sets or returns the text content of the selected element
- HTML ()-Sets or returns the contents of the selected element (including HTML tags)
- Val ()-Sets or returns the value of a form field
Get Property-attr ()
The JQuery attr () method is used to get the property value.
What is AJAX?
AJAX = Asynchronous JavaScript and XML (asynchronous JavaScript and XML).
Briefly, without overloading the entire Web page, AJAX loads the data in the background and displays it on the Web page.
jquery notes (W3cschool)