title: CSS cannot be applied to a form element through javascript, if doctype is set
body: <p>i have textbox like this:</p>
  
  <pre><code>&lt;input id="patId1" type="text" name="patId1" value=""&gt;
  </code></pre>
  
  <p>when the page loads, a script is called which sets the width of the textbox. That code is as follows : </p>
  
  <pre><code>document.getElementById("patId1").style.width = document.getElementById("patId2").offsetWidth;
  </code></pre>
  
  <p>where, patId2 is a dropdown list (select tag). Basically what i am trying to do is setting the width of textbox same as that of the width of dropdown list.</p>
  
  <p>Now, if DOCTYPE is set, then the above script doesn't work. But if it is not set, the width is applied.</p>
  
  <p>Any help.</p>