title: Any idea how to check if a div contains ONLY an image tag inside it?
body: <p>I've been trying to search this on stackoverflow but the answers arent exactly what im looking for, plus they use jquery. So is there any way of determing if a div element contains only an image element inside it, and therefore returning a boolean?
  I have tried things like:</p>
  <pre><code>&lt;div className={this.find('img').length}?'hasImg':'noImg'&gt;
   &lt;img src=''&gt;
    &lt;/div&gt;
  </code></pre>
  <p>but this returned false. Even if this would work, I'd like it to return true only if there is an image regardless if there is a p tag or something else inside.</p>