How to get the content of all spans that have the email attribute with JavaScript
<p>I want to find all spans in a document that have the "email" attribute and then for each email address i'll check with my server if the email is approved and inject to the span
content an img with a "yes" or a "no". I don't need the implementation of the PHP side, only JavaScript.</p>

<p>So say "newsletter@zend.com" is approved in my db and the HTML code is:</p>

<pre><code>&lt;span dir="ltr"&gt;&lt;span class="yP" email="newsletter@zend.com"&gt;Zend Technologies&lt;/span&gt;&lt;/span&gt;
</code></pre>

<p>Then the JavaScript will change the HTML to:</p>

<pre><code>&lt;span dir="ltr"&gt;&lt;span class="yP" email="newsletter@zend.com"&gt;&lt;img src="yes.gif" /&gt;Zend Technologies&lt;/span&gt;&lt;/span&gt;
</code></pre>

<p>I need someone to guide me to the right direction on how to approach this.</p>

<p>Note: i don't want to use jQuery.</p>
