jQuery – how to get version info

to get jQuery version info the variable jQuery.fn.jquery (or $.fn.jquery if $ is being used for jQuery object) can be used. Some examples.

jQuery version in code

<pre id="msg"></pre>

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script type="text/javascript">
  $("#msg").text("jQuery version: " + $.fn.jquery);

jQuery version in Chrome console

To quickly get jQuery version on a site, Chrome console can be used. Just type the following:

// or $.fn.jquery

The outcome will be something like this:

Share this article: share on Google+ share on facebook share on linkedin tweet this submit to reddit


Click here to write/view comments