Grabbing some content from an iframe
<p>I am trying to grab the content of a div from within an iframe. I have the following code:</p>

<pre><code>$('iframe').load(function() {
  setTimeout(function() {
    content = $("iframe").contents().find("div#totaltime").html();
    alert(content);
  }, 800);
});
</code></pre>

<p>My alert message says "undefined" and yet when I remove the ".html()" I get an alert saying "[object Object]" ... any ideas how to extract the contents of this div. There should just be a time in the div like "1:33" but when I run .text() instead of .html() I just get a blank alert. </p>

<p>This is the html from inside the iframe:</p>

<pre><code>&lt;div id="totaltime" class="item graytext" style="visibility: visible; left: 368px; top: 51px; width: 32px; height: 16px; font-size: 11px; font-family: Arial;"&gt;06:44&lt;/div&gt;
</code></pre>

<p>Thanks!</p>

<p><strong>UPDATE</strong></p>

<p>Ok, I've changed to:</p>

<pre><code>$(window).load(function() {
  setTimeout(function() {
    content = $("iframe").html();
    alert(content);
  }, 800);
});
</code></pre>

<p>Now I just get a blank alert box.</p>
