title: Required attribute HTML5
body: <p>Within my web application I am using some custom validation for my form fields. Within the same form I have two buttons: one to actually submit the form and the other to cancel/reset the form.</p>
  
  <p>Mostly I use Safari as my default browser. Now Safari 5 is out and suddenly my cancel/reset button didn't work anymore. Every time I did hit the reset button the first field in my form did get the focus. However this is the same behavior as my custom form validation. When trying it with another browser everything just worked fine. I had to be a Safari 5 problem.</p>
  
  <p>I changed a bit in my Javascript code and I found out that the following line was causing the problem:</p>
  
  <pre><code>document.getElementById("somefield").required = true;
  </code></pre>
  
  <p>To be sure that would be really the problem I created a test scenario:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;Test&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
      &lt;form id="someform"&gt;
          &lt;label&gt;Name:&lt;/label&gt;&amp;nbsp;&lt;input type="text" id="name" required="true" /&gt;&lt;br/&gt;
          &lt;label&gt;Car:&lt;/label&gt;&amp;nbsp;&lt;input type="text" id="car" required="true" /&gt;&lt;br/&gt;
          &lt;br/&gt;
          &lt;input type="submit" id="btnsubmit" value="Submit!" /&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>What I expected would happen did happen. The first field "name" did get the focus automatically.</p>
  
  <p>Anyone else stumbled into this?</p>