jQuery jquery Property

Introduction

Alert the current running jQuery version:

View in separate window

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
  $("button").on("click",function(){
    var version = $().jquery;//ww  w  . ja v a  2 s.c o m
    document.getElementById("demo").innerHTML = 
      "You are running jQuery version: " + version;
  });
});
</script>
</head>
<body>

<p id="demo"></p>
<button>Click me!</button>

</body>
</html>

The jquery property returns a string containing the jQuery version number.

$().jquery



PreviousNext

Related