jQuery: Adding a class to an element when it contains an image, but only if there are no text nodes
<p>I want jQuery to add a <code>class</code> of <code>diog-fail</code> to an <code>&lt;a></code> when it contains an <code>&lt;img /></code> but does not contain a string of text, or another HTML element that contains a string of text. The 2 examples below would be false:</p>

<pre><code>&lt;a href="#"&gt;
    &lt;img width="100" height="100" alt="alternative text" src="some/location/image.gif" /&gt;
    Some text
&lt;/a&gt;

&lt;a href="#"&gt;
    &lt;img width="100" height="100" alt="alternative text" src="some/location/image.gif" /&gt;
    &lt;span&gt;Some text&lt;/span&gt;
&lt;/a&gt;
</code></pre>

<p>The following example would have jQuery apply the <code>class</code> of <code>diog-fail</code>:</p>

<pre><code>&lt;a href="#"&gt;
    &lt;img width="100" height="100" alt="alternative text" src="some/location/image.gif" /&gt;
&lt;/a&gt;
</code></pre>

<p><strong>Important:</strong> The string of text could be anything.</p>
