1. Download the JQuery library. It can be reached by visiting the JQuery official website in this following link.
2. Store the downloaded JQuery library in the exact location. Normally or usually, it is stored in a folder named ‘js’ placed in the root folder of the web application. For an example, it is shown below :
user@hostname:/var/www/html/jquery# tree -L 2 . . ├── js │ └── jquery-3.2.1.min.js ├── logs │ ├── localhost.jquery.web-access_log │ └── localhost.jquery.web-error_log └── simple-jquery.html 2 directories, 4 files user@hostname:/var/www/html/jquery#
3. Define the JQuery library in the web page file before actually using it. To define it, just try to import it in a web page file as shown below and place it and insert it in the ‘<head></head>’ section :
4. Below is the simple JQuery snippet code which can be available and can be defined insert the ‘<script></script>’ section :
In the above definition, it will display a pop-up message with the text ‘Click H1 !’ in it. The pop-up message will appear everytime a H1 HTML element is being clicked. So, below is the snippet code from the web page file of HTML where there is an H1 HTML element defined as follows :
<html> <head> <title>Index Simple JQuery</title> </head> <body> <h1>Testing JQuery</h1> </body> </html>
So, if the JQuery import definition and also the JQuery snippet code is inserted in between the tag ‘<head></head>’ section as shown below :