jQuery global context
<p>Assuming the following html structure :</p>

<pre><code>&lt;div id="anId"&gt;
    &lt;span id="1"&gt; aSpan &lt;/span&gt;
    &lt;span id="2"&gt; anotherSpan &lt;/span&gt;
&lt;/div&gt;
&lt;span id="3"&gt; anOutsideSpan &lt;/span&gt;
</code></pre>

<p>Is there a way to define a "global context" for jQuery selectors? Something like:</p>

<pre><code>$(IDoNotKnowWhatToDoHere). SomethingAboutContext; // Defining the context as div#anID

$('span').doSomething; // Action only on span#1 and span#2 and not on span#3

$('span#1').doSomethingElse;

$('span').doSomethingStrange;

$('span#2').doSomethingCool;

$(SomethingAboutRemovingGlobalContext); //Removing the context
</code></pre>

<p>That way i can avoid doing this :</p>

<pre><code>$('div#anId span').doSomething; // Action only on span#1 and span#2 and not on span#3

$('div#anId span').doSomethingElse; // Same as last code comment

$('div#anId span#1').doSomethingStrange; // Same as last code comment

$('div#anId span#2').doSomethingCool; // Same as last code comment
</code></pre>

<p>There is only 4 actions here but the code i'm working on has something like 100.</p>

<p>I want to avoid always repeting the <code>div#anId</code>.</p>

<ul>
<li><p>Keep in mind it's an example, not actual code.</p></li>
<li><p>My question is not about chaining.</p></li>
</ul>
