title: jQuery .attr('type', 'submit') on a button element giving me a strange error in IE7
body: <p>I'm parsing a JSON response via <code>$.ajax()</code> and building a form from this object's values.  The script I've written is long, but here's what it's doing:</p>
  
  <ol>
  <li><p>Dynamically creating:<br>
  ~ a form element,<br>
  ~ a fieldset element,<br>
  ~ a button element,<br>
  ~ 20 or so text inputs and label elements</p></li>
  <li><p>Appending the inputs and labels to the fieldset</p></li>
  <li><p>Appending the button to the fieldset</p></li>
  <li><p>Appending the fieldset to the form</p></li>
  <li>Appending the form to an element in the existing DOM.</li>
  </ol>
  
  <p>Everything is working in all browsers except one small snippet in IE.  I've narrowed it down to the following piece of code.  (<code>doc</code> is a variable containing <code>document</code>)</p>
  
  <pre><code>fieldset.append(
      $(doc.createElement('button'))
          .addClass('ui-button')
          .attr('type', 'submit')
          .html('Re-Rate')
          .button()
  );
  </code></pre>
  
  <p>This is step 3 from above.  It creates a button element, adds a class, sets the <code>type</code> attribute to <code>submit</code>, gives it some text, and then appends it to the fieldset.  IE fails with the error "Object doesn't support this action"</p>
  
  <p>If I comment out the <code>.attr()</code> line like this:</p>
  
  <pre><code>fieldset.append(
      $(doc.createElement('button'))
          .addClass('ui-button')
          //.attr('type', 'submit')
          .html('Re-Rate')
          .button()
  );
  </code></pre>
  
  <p>Everything works as expected.</p>
  
  <p>If you're wondering, the <code>.button()</code> method is jQuery UI</p>