How to Check jQuery Version in Console
Checking the version of jQuery running on any webpage is a quick and straightforward task using your browser's developer tools. This article outlines the exact commands you need to execute in the console to retrieve the active jQuery version, how to handle standard shorthand aliases, and how to troubleshoot scenarios where jQuery might not be immediately accessible.
Step 1: Open the Browser Console
First, navigate to the webpage you want to inspect and open the developer tools:
- Windows / Linux: Press
F12orCtrl + Shift + I - macOS: Press
Cmd + Option + I
Once the developer tools open, click on the Console tab.
Step 2: Run the Version Command
To check the loaded jQuery version, type either of the following standard commands and press Enter:
$.fn.jqueryor
jQuery.fn.jqueryBoth commands will return a string indicating the exact version
number, such as "3.6.0" or "1.12.4".
Alternative Commands
You can also retrieve the version by calling an empty jQuery object:
$().jqueryThis functions identically to $.fn.jquery because
$.fn is an alias for the jQuery prototype
(jQuery.prototype).
Troubleshooting Common Issues
Uncaught ReferenceError: $ is not defined
This error indicates that jQuery is either not loaded on the page or the$alias has been disabled usingjQuery.noConflict(). In this scenario, try runningjQuery.fn.jquery. If both fail, jQuery is not present on the document.Incorrect Version Returned
If multiple scripts load conflicting libraries, the$variable may be overwritten by another framework like Prototype or MooTools. Always usejQuery.fn.jqueryto ensure you are referencing the jQuery object specifically.Sites Using iframes
If the application is embedded within an<iframe>, make sure to use the console's execution context dropdown (often labeled "top") to switch to the specific frame running jQuery before executing the command.