Using the Browser Console
To get the jQuery version in the console, you can simply use the $.fn.jquery or jQuery.fn.jquery property. Open the browser console by right-clicking on the web page, selecting “Inspect”, and then clicking on the “Console” tab. Once the console is open, type one of the following commands and press Enter:
The console will display the jQuery version being used by the website, such as “3.6.0”.
document.write("jQuery Version: " + $.fn.jquery);
document.write("jQuery Version: " + jQuery.fn.jquery);
Place the above code snippet inside a <script> tag in your HTML file, and the jQuery version will be displayed on the web page.
In this blog post, we learned how to get the jQuery version in the console using either the $.fn.jquery or jQuery.fn.jquery property. This is helpful in determining which version of jQuery is being used by a website, allowing you to ensure that your code is compatible with the specific version. If you are just getting started with jQuery, it’s a good idea to familiarize yourself with the different versions, as some functions may only be available in certain releases.