title: Append jQuery code into iframe does not work
body: <p>I encounter a very strange problem!</p>
  
  <p>I wrote the following code:</p>
  
  <pre><code>&lt;script type="text/javascript" src="jquery-1.8.3.min.js"&gt;&lt;/script&gt;
  
  &lt;textarea id="code"&gt;
      &lt;div id="hello"&gt;Hello world!&lt;/div&gt;
      &lt;script type="text/javascript"&gt;
      $(function(){
          $("#hello").css({"border":"solid 3px red"});
          alert($("#hello").size());
      });
      &lt;/script&gt;
  &lt;/textarea&gt;
  
  &lt;iframe src="iframe.html"&gt;&lt;/iframe&gt;
  
  &lt;script type="text/javascript"&gt;
      $(function(){
          $("iframe").on("load",function(){
              $(this).contents().find("body").append($("#code").val());
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>The "iframe.html" file contains only a call to the jQuery library.</p>
  
  <p>The result is that "Hello world!" is displayed in the iframe but without red border! It seems that <code>$("#hello")</code> does not work. In fact, if I do <code>alert($("#hello").size())</code>, I get "0".</p>
  
  <p>Do you have any idea?
  Thanks!</p>
  
  <p>Edit: Add "alert".</p>