what is the most lightweight solution to repeatedly access html element with jquery?
<p>regarding html elements that are being referenced frequently in code, such as a menu that is being shown/hidden often, what is the most lightweight jquery solution to re-access the element multiple times?</p>

<p>my current approach is to save the result in a variable (non global of course).</p>

<p>example:</p>

<pre><code>$myElement = $('#my-element');
</code></pre>

<p>then use <code>$myElement</code> rather than <code>$('#my-element')</code> in all code that running withtin he scope of the variable.</p>

<p>another approach I am using is the $.data() method. I use this when I need to access one element based on another.</p>

<p>example: </p>

<pre><code>$myElement.data('friend', $('my-element-friend'));
</code></pre>

<p>then use <code>$myElement.data('friend')</code> instead of  <code>$('my-element-friend')</code></p>

<p>Are there other options to consider?
Are there cases where its best to simply repeat <code>$('#my-element')</code> each time that I wish to access the element? (aside from when the reference is only used once in the entire runtime of the application)</p>
