Some of the features of the Jquery library are:
Jquery uses Document Object Model(DOM) manipulation library to traverse and select objects. All the elements of a webpage are represented in the form of a tree wherein jquery syntax is used for finding, selecting and traversing the elements of the DOM. Lets us look at the syntax of how jquery can be used to simplify the code:
As you can see, $(selector).action(), the document is the selector and .ready is the inbuilt methd of the jquery library which is used in calling a function. Now let’s look at an example to understand the functionality. Here is how you can manipulate data using DOM of the jquery library.
Just like CSS elements find HTML elements for adding style and beautification, in the same way, jquery selectors use DOM elements for applying effects or setting up event listeners. The syntax used for jquery selectors is $(Xyz), with a string( in place of Xyz) passed into that which is used to identify a particular element.
Some of the common ways using which the element selection happens is ;
When using a Tag name, use the tag names like h1 or div as seen in the example before. That is an example where the jquery selectors is used for writing data into the h1 tag in the example.
Here is an example of how “select by ID” is used in CSS and how jquery can be used to simplify the code and make things easy.
Now by using Jquery Selector
In CSS we can also select elements by giving a class name to that particular tag or element
For examples in CSS
Using jquery data can be appended by referring to the class name of that particular tag
Creating a new element using jquery is very simple. The syntax that can be used for creating a new tag and add other tags such as h1 or list is :
Actions or event handlers are functions that are activated by user interactions on your website/webpage. For suppose your website has a text input box and a button where the user can enter his details and click on the button to submit the data, an action can be triggered to store the data that is being entered in the text field upon clicking the submit button.
It is the responsibility of the event handler to start the logic when the user interacts with a particular item on the webpage. Here is the example on how the jquery event handler can be used
Using jquery Ajax methods you can request text, HTML, JSON, or XML from a remote server using the get and post methods, and also you can directly write data into any HTML element of your website.
Micropyramid is a software development and cloud consulting partner for enterprise businesses across the world. We work on python, Django, Salesforce, Angular, Reactjs, React Native, MySQL, PostgreSQL, Docker, Linux, Ansible, git, amazon web services. We are Amazon and salesforce consulting partner with 5 years of cloud architect experience. We develop e-commerce, retail, banking, machine learning, CMS, CRM web and mobile applications.
Django-CRM :Customer relationship management based on Django
Django-blog-it : django blog with complete customization and ready to use with one click installer Edit
Django-webpacker : A django compressor tool
Django-MFA : Multi Factor Authentication
Docker-box : Web Interface to manage full blown docker containers and imagesMore...