How to check what version of jQuery is loaded?

Viewed 491173

How do I check which version of jQuery is loaded on the client machine? The client may have jQuery loaded but I don't know how to check it. If they have it loaded how do I check the version and the prefix such as:

$('.class')
JQuery('.class')
13 Answers

In one line and the minimum of keystrokes (oops!):

alert($().jquery);

As per Template monster blog, typing, these below scripts will give you the version of the jquery in the site you are traversing now.

 1. console.log(jQuery.fn.jquery);
 2. console.log(jQuery().jquery);

Go to the developer's Tool > console and write one of the following command jQuery.fn.jquery console.log(jQuery().jquery);

With optional chaining operator (?.) this can be done with window.jQuery?.fn?.jquery. This one liner also works if jQuery isn't loaded at all.

Related