How to determine and print jQuery version?


Javascript Problem Overview

Is there a jQuery function that returns the version of jQuery that is currently loaded?

Javascript Solutions

Solution 1 - Javascript

You can use this:

//or if you're using .noConflict():

It's updated automatically when jQuery is built, defined here:

Make sure to use $ for properties that don't depend on an object, no reason to create an unneeded jquery object with $().property unless you intend to use it :)

Solution 2 - Javascript

alert( $.fn.jquery )

Solution 3 - Javascript

I'm not sure how many versions of jQuery this exists in, but a jQuery object has a jquery property that stores the version.

alert( $().jquery );

Will alert 1.4.2 if you're using that version.

Solution 4 - Javascript


This will return a string containing the jQuery version

Solution 5 - Javascript

$().jquery; // yields the string "1.4.2", for example


Solution 6 - Javascript



Solution 7 - Javascript

Alert is good, but if you want to actually print the jquery version...



All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJames McMahonView Question on Stackoverflow
Solution 1 - JavascriptNick CraverView Answer on Stackoverflow
Solution 2 - Javascriptmeder omuralievView Answer on Stackoverflow
Solution 3 - Javascriptuser113716View Answer on Stackoverflow
Solution 4 - JavascriptJosiahView Answer on Stackoverflow
Solution 5 - JavascriptFaisalView Answer on Stackoverflow
Solution 6 - JavascriptGabriele PetrioliView Answer on Stackoverflow
Solution 7 - JavascriptiewebguyView Answer on Stackoverflow