Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

jQuery | context Property

  • Last Updated : 27 Mar, 2019

The DOM node context contains original passed to jQuery(), Which is a dom node context if there is no node passed then context will be the document.


Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.



<!DOCTYPE html>
    <meta charset="utf-8">
      context demo
    <script src=
    $(document).ready(function() {
        $("button").click(function() {
             .append("<li>" + $("ul")
                   .context + "</li>")
             .append("<li>" + $("ul", document.body)
                   .context.nodeName + "</li>");
    <h1 style="color:green;"
</h1> Context:

Before Click:

After Click:

Note: The context property was removed in jQuery version 3.0.

My Personal Notes arrow_drop_up
Recommended Articles
Page :