How to check what version of jQuery is loaded?

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')

12 s
12

if (typeof jQuery != 'undefined') {  
    // jQuery is loaded => print the version
    alert(jQuery.fn.jquery);
}

Leave a Comment