title: Weird behaviour of iframe `name` attribute set by jQuery in IE
body: <p>I'm doing an ajax style file upload by posting the file in a form to an iframe and noticed some weird behaviour in IE (seems to happen in both 6 &amp; 8). Basically in IE the form doesn't <code>target</code> the iframe properly so the response appears in a new window (instead of in the iframe). You can reproduce the problem with the following minimal set of HTML/JS:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
    &lt;script src="http://code.jquery.com/jquery-1.3.2.js"&gt;&lt;/script&gt;
    &lt;script&gt;
      $(document).ready(function(){
        var frameName = "myFrame";
        var $iframe = $("&lt;iframe src=\"about:blank\" /&gt;")
                .attr("name", frameName)
                .appendTo("body");
        var $uploadForm = $("&lt;form action=\"http://www.google.com/search\" /&gt;")
                .attr("target", frameName)
                .append("&lt;input type=\"text\" name=\"q\" /&gt;")
                .append("&lt;input type=\"submit\" /&gt;")
                .appendTo("body");
      });
    &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Now (before you post an answer), I did some investigation (using IE8's developer tools) and it appears that the <code>.attr("name", frameName)</code> is actually adding the attribute as <code>submitName="myFrame"</code> instead of simply <code>name="myFrame"</code>. Based on this, I solved the issue by changing the iframe creation code to the slightly nastier:</p>
  
  <pre><code>var $iframe = $("&lt;iframe src=\"about:blank\" name=\"" + frameName + "\" /&gt;")
          .appendTo("body");
  </code></pre>
  
  <p>Making this change makes the form post into the iframe as desired.</p>
  
  <p><strong>My questions are</strong>:</p>
  
  <ul>
  <li>Why doesn't <code>.attr("name", ...)</code> work as expected?</li>
  <li>Is it a bug in jQuery, a bug in IE (surely not!?!), or am I missing something obvious?</li>
  <li>Where does the <code>submitName</code> attribute come from &amp; what's its purpose?</li>
  </ul>