Basic Example Program using Alerts


To use jQuery in a web project, you typically include the jQuery library in your HTML file, either by downloading it and hosting it locally or by using a Content Delivery Network (CDN). Once included, you can start using jQuery methods to interact with and manipulate the DOM.

The $(document).ready() function ensures that the jQuery code executes once the DOM is fully loaded. This is a common practice to prevent issues with manipulating elements that haven't been rendered yet.

Source Code

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Hello World</title>
    <!--------META-------->
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    
    <!------JQUERY CDN---->
    <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
  </head>
  <body>
    <h3>Hello World</h3>
    
    <script>
    	$(document).ready(function(){
    	alert("Hello World from JQUERY...!");
    	});
    </script>
  </body>
</html>

<script> : Contains JavaScript code.

alert("Hello World from JQUERY...!");: Within the function, an alert is used to display a pop-up dialog with the message "Hello World from JQUERY...!"

In summary, this HTML document includes the jQuery library and uses it to display an alert with the message "Hello World from JQUERY...!" when the document is fully loaded. It's a simple example demonstrating the integration of jQuery into an HTML page.

To download raw file Click Here