Is there a way to find out what version of jQuery is being used by inspecting the jQuery object? jQuery is dynamically getting added to my page and I cannot see any reference to it in my markup. If I inspect it in my browser's console, it's there.
7 Answers
You can use either $().jquery; or $.fn.jquery which will return a string containing the version number, e.g. 1.6.2.
4 Comments
1.4 for jQuery.fn.jquery$.fn.jquery, no need to call the $ function nowimport jQuery from jquery$().jquery will give you its version as a string.
2 Comments
For older versions of jQuery
jQuery().jquery (or)
jQuery().fn.jquery
For newer versions of jQuery
$().jquery (or)
$().fn.jquery
1 Comment
jQuery().jquery worked for me with a very old version of jQuery (embedded on a legacy project): 1.10.2You can get the version of the jquery by simply printing object.jquery, the object can be any object created by you using $.
For example: if you have created a <div> element as following
var divObj = $("div");
then by printing divObj.jquery will show you the version like 1.7.1
Basically divObj inherits all the property of $() or jQuery() i.e if you try to print jQuery.fn.jquery will also print the same version like 1.7.1

