title: Check for element inside an iframe exist
body: <p>I have a iframe embeded in my page. I saw an paper icon with sad face in it.</p>
  <p><a href="https://i.stack.imgur.com/FLE7k.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FLE7k.png" alt="enter image description here" /></a></p>
  <p>I inspect it, it has an id <code>#sub-frame-error-details</code></p>
  <hr />
  <h1>iFrame</h1>
  <pre><code>&lt;iframe id=&quot;iframe-rm&quot; name=&quot;my-iframe&quot; src=&quot;https://192.237.175.25:555/&quot; width=&quot;100%&quot; height=&quot;800px&quot; class=&quot;&quot;&gt;&lt;/iframe&gt;
  </code></pre>
  <hr />
  <h1>Try #1</h1>
  <p><code>console.log($('#sub-frame-error-details').length);</code></p>
  <p>I kept getting 0.</p>
  <hr />
  <h1>Try #2</h1>
  <p><code>document.getElementById(&quot;sub-frame-error-details&quot;)</code></p>
  <p>I got <code>null</code></p>
  <hr />
  <h1>Try #3</h1>
  <p><code>var obj = $(&quot;#iframe-rm&quot;).contents().find(&quot;#main-frame-error&quot;);</code></p>
  <p><code>console.log(obj.length);</code></p>
  <p>still get <code>0</code> print out.</p>
  <p>How do I detect if it's there ?</p>