jQuery context Property Last Updated : 11 Jul, 2023 Comments Improve Suggest changes Like Article Like Report The DOM node context contains the original passed to jQuery(), Which is a dom node context if there is no node passed then the context will be the document. Syntax: contextExamples: In this example, we are using the above-explained property. html <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> context demo </title> <script src= "https://code.jquery.com/jquery-1.10.2.js"> </script> <script> $(document).ready(function () { $("button").click(function () { $("ul") .append("<li>" + $("ul") .context + "</li>") .append("<li>" + $("ul", document.body) .context.nodeName + "</li>"); }); }); </script> </head> <body> <h1 style="color:green;"> GeeksForGeeks </h1> Context: <ul></ul> <button>Click</button> </body> </html> Output: Note:The context property was removed in jQuery version 3.0. Create Quiz Comment V Vijay Sirra Follow 0 Improve V Vijay Sirra Follow 0 Improve Article Tags : JQuery jQuery-Propertie Explore jQuery Tutorial 7 min read Getting Started with jQuery 4 min read jQuery Introduction 7 min read jQuery Syntax 2 min read jQuery CDN 4 min read jQuery SelectorsJQuery Selectors 5 min read jQuery * Selector 1 min read jQuery #id Selector 1 min read jQuery .class Selector 1 min read jQuery EventsjQuery Events 4 min read jQuery bind() Method 2 min read jQuery blur() Method 1 min read jQuery change() Method 2 min read jQuery EffectsjQuery animate() Method 2 min read jQuery clearQueue() Method 2 min read jQuery delay() Method 2 min read jQuery HTML/CSSjQuery addClass() Method 2 min read jQuery after() Method 1 min read jQuery append() Method 2 min read jQuery TraversingjQuery | Traversing 4 min read jQuery add() method 1 min read jQuery addBack() Method 2 min read Like