How to iterate through all the sub elements of an element
<p>If I have a html dom as shown below, with out using any library (like jQuery) how can I iterate through all the sub elements of any given element. I need to check whether some custom attributes are set on those elements.</p>

<pre><code>&lt;div id="testme"&gt;
    &lt;span&gt;&lt;a&gt;&lt;/a&gt;&lt;/span&gt;
    &lt;div&gt;
        &lt;ul&gt;
            &lt;li&gt;&lt;a&gt;&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
    &lt;/div&gt;
&lt;/div&gt;
</code></pre>
