What jQuery version is my website using? Complete guide on how to check
  John Mwaniki /   01 Nov 2021

What jQuery version is my website using? Complete guide on how to check

jQuery is a JavaScript library designed to simplify HTML DOM tree traversal and manipulation, as well as event handling, CSS animation, and Ajax.

According to W3Techs, jQuery library is used by 78.3% of all the websites at the time of writing this article. It is the most widely deployed JavaScript library by a large margin, having at least 3 to 4 times more usage than any other JavaScript library.

jQuery library was originally released in January 2006 by John Resig at BarCamp NYC.

It is currently maintained by a team of developers(The jQuery Team) led by Timmy Willison.

Since its inception, jQuery has been going through a series of updates with many version releases over that period. These updates have been to introduce new features, improve efficiency and fix any issues in the previous versions.

Upgrading to the latest version of jQuery makes your website more secure, and potentially a little faster in terms of script execution time and loading time.

Checking jQuery version on your website

If your website uses jQuery, and you would like to find out which version it is using, here is how to do it:

Open the website source code by right-clicking on any page of your website and selecting the "View page source" option.

Website right-click view page source option

Alternatively, you can press Ctrl + U and it will open the page source.

Another way to open the page source in case the right-clicking on the page and the use of "Ctrl+U" has been disabled is to add "view-source:" in the address bar before the page URL.

In the source code check for a link with the name jquery in it. In most cases, it will be named jquery.js or jquery.min.js. In some instances, it may contain the version in its name eg. jquery-3.4.1.min.js. Click on that jQuery link so that the file is opened in the browser.

Javascript files in a website page source

In the jQuery file code at the very top, you will be able to view the version.

jQuery version in source code

That way, you will be able to know which version of jquery your website or basically any website is using.

How to check jQuery version using jQuery code

You can alternatively write a single line of code to check the jQuery version in your website.

Just alert the output of jQuery.fn.jquery in one of your web pages as shown below:

<script>
alert("jQuery version: "+jQuery.fn.jquery);
</script>

The above code will output the alert box with the jQuery version of your website as shown below.

Javascript alert box with jQuery version

Though by wanting to check the jQuery version it means you already have jQuery installed on your website, you may want to use jQuery.fn.jquery within an if condition that first checks whether jQuery is installed on the web page.

<script>
if (typeof jQuery != 'undefined') {  
    alert("jQuery version: "+jQuery.fn.jquery);
}
else {
    alert("jQuery not installed");
}
</script>

That's it! Now you can comfortably check which jQuery version your website(or any website that uses jQuery) is using.