Check if a given DOM element is ready
<p>Is there a way of checking if the HTML DOM element/s for a given selector/element are ready yet using jQuery or JavaScript? </p>

<p>Looking at the jQuery <a href="http://api.jquery.com/ready">api</a> for the ready function it looks like it can only be used with the document object. If ready cannot be used for this purpose is there another way of doing this?</p>

<p>e.g.</p>

<pre><code> $('h1').ready(function()
{
 //do something when all h1 elements are ready
});
</code></pre>

<p>Obviously I could use </p>

<pre><code>$(document).ready(function()
{
 //do something when all h1 elements are ready
});
</code></pre>

<p>But if all the h1's load first then the code specific to h1 elements will only execute after the whole document is ready even though it could actually execute earlier.</p>

<p>Thanks in advanced for the help.</p>
