.context    **DEPRECATED**S2C Home « Core & Internals « .context

The original context passed to jQuery().

Description

The .context property holds the original context passed to jQuery() which could be a DOM node context, or generally the document context, if no node was passed.

This method was deprecated in jQuery 1.10 so we are just showing it for completeness.

Syntax


Signature Description
.contextThe original context passed to jQuery().

Parameters

None.

Return

An element from the DOM or the document context.

.context Examplego to top of page Top

The original context passed to jQuery() which could be a DOM node context, or generally the document context, if no node was passed.


$(function(){
  $('#btn').on('click', function() { 
    var context = $('*').context; 
    alert(context); 
  });
}); 

Press the button below to action the above code:


go to home page Homepage go to top of page Top