How to implement the jQuery ?

Hello all,

In this blog, I’m going to explain how to implement the jQuery?

Here we go, Download the jQuery.js file from http://jquery.com/download/(Download Compressed and production jQuery) then create a folder called js and save into it as jQuery.js
or Directly add the following line into your file, http://code.jquery.com/jquery-2.1.3.min.js.

In your php file add the following line to include the jquery file
1. If you created the folder called js then add the following line,

script type="text/javascript" src="js/jquery.js"></script>

2. If you going to add the direct link then include the following link,

script type="text/javascript" src="http://code.jquery.com/jquery-2.1.3.min.js"></script>

Example:

<!doctype html>
<html lang ="en">
<head>
<meta charset="utf-8">
<title> jQuery implementing</title>
</head>
<link rel="stylesheet" type="text/css" href="css/style.css"> 

<script type="text/javascript" src="http://code.jquery.com/jquery-2.1.3.min.js"></script>

</body>
</html>

Lets check it by using simple onclick function,

<!doctype html>
<html lang ="en">
<head>
<meta charset="utf-8">
<title> Selectors</title>
</head>
<link rel="stylesheet" type="text/css" href="css/style.css">
<p onclick=alert("Welcome to geeks.gallery")>click me</p>
<script type="text/javascript" src="http://code.jquery.com/jquery-2.1.3.min.js"></script>


</body>
</html>

Thanks for reading.
Feedbacks are welcome.

Leave a Reply

Your email address will not be published. Required fields are marked *