{"id":462,"date":"2026-08-10T19:12:35","date_gmt":"2026-08-10T19:12:35","guid":{"rendered":"https:\/\/api.jquery.com\/?p=462"},"modified":"2026-08-10T19:12:35","modified_gmt":"2026-08-10T19:12:35","slug":"jquery-2","status":"publish","type":"post","link":"https:\/\/api.jquery.com\/jquery-2\/","title":{"rendered":".jquery"},"content":{"rendered":"<article id=\"jquery1\" class=\"entry property\"><h2 class=\"section-title\">\n<span>jquery<\/span><span class=\"returns\">Returns: <a href=\"http:\/\/api.jquery.com\/Types\/#String\">String<\/a><\/span>\n<\/h2>\n<div class=\"entry-wrapper\">\n<p class=\"desc\"><strong>Description: <\/strong>A string containing the jQuery version number.<\/p>\n<ul class=\"signatures\"><li class=\"signature\"><h4 class=\"name\">\n<span class=\"version-details\">version added: <a href=\"\/category\/version\/1.0\/\">1.0<\/a><\/span>jquery<\/h4><\/li><\/ul>\n<div class=\"longdesc\" id=\"entry-longdesc\">\n    <p>The <code>.jquery<\/code> property is assigned to the jQuery prototype, commonly referred to by its alias <code>$.fn<\/code>. It is a string containing the version number of <code>jQuery<\/code>, such as \"1.5.0\" or \"1.4.4\".<\/p>\n  <\/div>\n<section class=\"entry-examples\" id=\"entry-examples\"><header><h2>Examples:<\/h2><\/header><div class=\"entry-example\" id=\"example-0\">\n<h3>\n\t\t\t\tExample 1<\/h3>\n<p>Determine if an object is a jQuery object<\/p>\n<div class=\"syntaxhighlighter javascript\">\n\t<table>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t\n\t\t\t\t<td class=\"gutter\">\n\t\t\t\t\t\n\t\t\t\t\t\t<div class=\"line n1\">1<\/div>\n\t\t\t\t\t\n\t\t\t\t\t\t<div class=\"line n2\">2<\/div>\n\t\t\t\t\t\n\t\t\t\t\t\t<div class=\"line n3\">3<\/div>\n\t\t\t\t\t\n\t\t\t\t\t\t<div class=\"line n4\">4<\/div>\n\t\t\t\t\t\n\t\t\t\t\t\t<div class=\"line n5\">5<\/div>\n\t\t\t\t\t\n\t\t\t\t\t\t<div class=\"line n6\">6<\/div>\n\t\t\t\t\t\n\t\t\t\t\t\t<div class=\"line n7\">7<\/div>\n\t\t\t\t\t\n\t\t\t\t\t\t<div class=\"line n8\">8<\/div>\n\t\t\t\t\t\n\t\t\t\t\t\t<div class=\"line n9\">9<\/div>\n\t\t\t\t\t\n\t\t\t\t\t\t<div class=\"line n10\">10<\/div>\n\t\t\t\t\t\n\t\t\t\t<\/td>\n\t\t\t\t\n\t\t\t\t<td class=\"code\">\n\t\t\t\t\t<pre><div class=\"container\"><div class=\"line\"><code><span class=\"hljs-keyword\">var<\/span> a = { <span class=\"hljs-attr\">what<\/span>: <span class=\"hljs-string\">\"A regular JS object\"<\/span> },<\/code><\/div><\/div><div class=\"container\"><div class=\"line\"><code>  b = $( <span class=\"hljs-string\">\"body\"<\/span> );<\/code><\/div><\/div><div class=\"container\"><div class=\"line\"><code> <\/code><\/div><\/div><div class=\"container\"><div class=\"line\"><code><span class=\"hljs-keyword\">if<\/span> ( a.jquery ) { <span class=\"hljs-comment\">\/\/ Falsy, since it's undefined<\/span><\/code><\/div><\/div><div class=\"container\"><div class=\"line\"><code>  alert( <span class=\"hljs-string\">\"a is a jQuery object!\"<\/span> );<\/code><\/div><\/div><div class=\"container\"><div class=\"line\"><code>}<\/code><\/div><\/div><div class=\"container\"><div class=\"line\"><code> <\/code><\/div><\/div><div class=\"container\"><div class=\"line\"><code><span class=\"hljs-keyword\">if<\/span> ( b.jquery ) { <span class=\"hljs-comment\">\/\/ Truthy, since it's a string<\/span><\/code><\/div><\/div><div class=\"container\"><div class=\"line\"><code>    alert( <span class=\"hljs-string\">\"b is a jQuery object!\"<\/span> );<\/code><\/div><\/div><div class=\"container\"><div class=\"line\"><code>}<\/code><\/div><\/div><\/pre>\n\t\t\t\t<\/td>\n\t\t\t<\/tr>\n\t\t<\/tbody>\n\t<\/table>\n<\/div>\n\n<\/div>\n<div class=\"entry-example\" id=\"example-1\">\n<h3>\n\t\t\t\tExample 2<\/h3>\n<p>Get the current version of jQuery running on the page<\/p>\n<div class=\"syntaxhighlighter javascript\">\n\t<table>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t\n\t\t\t\t<td class=\"gutter\">\n\t\t\t\t\t\n\t\t\t\t\t\t<div class=\"line n1\">1<\/div>\n\t\t\t\t\t\n\t\t\t\t<\/td>\n\t\t\t\t\n\t\t\t\t<td class=\"code\">\n\t\t\t\t\t<pre><div class=\"container\"><div class=\"line\"><code>alert( <span class=\"hljs-string\">\"You are running jQuery version: \"<\/span> + $.fn.jquery );<\/code><\/div><\/div><\/pre>\n\t\t\t\t<\/td>\n\t\t\t<\/tr>\n\t\t<\/tbody>\n\t<\/table>\n<\/div>\n\n<\/div><\/section>\n<\/div><\/article>","protected":false},"excerpt":{"rendered":"<p>A string containing the jQuery version number.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[41,60],"tags":[],"class_list":["post-462","post","type-post","status-publish","format-standard","hentry","category-internals","category-jquery-object-instance-properties"],"_links":{"self":[{"href":"https:\/\/api.jquery.com\/wp-json\/wp\/v2\/posts\/462","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/api.jquery.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/api.jquery.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/api.jquery.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/api.jquery.com\/wp-json\/wp\/v2\/comments?post=462"}],"version-history":[{"count":1,"href":"https:\/\/api.jquery.com\/wp-json\/wp\/v2\/posts\/462\/revisions"}],"predecessor-version":[{"id":463,"href":"https:\/\/api.jquery.com\/wp-json\/wp\/v2\/posts\/462\/revisions\/463"}],"wp:attachment":[{"href":"https:\/\/api.jquery.com\/wp-json\/wp\/v2\/media?parent=462"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/api.jquery.com\/wp-json\/wp\/v2\/categories?post=462"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/api.jquery.com\/wp-json\/wp\/v2\/tags?post=462"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}