How to get the content of iframe using jQuery or C#?
<p>I have this code in an iframe:</p>

<p><strong>HTML CODE</strong></p>

<pre><code>  &lt;iframe id="iframe"&gt;
     .......
     &lt;div id="message-box" class="error"&gt;
       No flights found
     &lt;/div&gt;
     .......
  &lt;/iframe&gt;
</code></pre>

<p>I want to run a JavaScript function when the iframe completely loads and get this inner div and its text. How can I do that?</p>

<p>Here is some code:</p>

<p><strong>JS CODE</strong></p>

<pre><code>  var content = $("#iframe").contents().find("#message-box").html();
</code></pre>

<p><a href="https://i.stack.imgur.com/qswWt.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qswWt.jpg" alt="error images click here"></a></p>