title: Change text input border color
body: <p>I want to make a form where data is verified using JavaScript before being sent.
  When a field is empty, I want to set its border to red.</p>
  
  <p>HTML code:</p>
  
  <pre><code>&lt;label&gt;Question: &lt;/label&gt;&lt;input type = "text" maxlength = "100" name = "question"&gt; &lt;br /&gt;
  </code></pre>
  
  <p>JavaScript code 1:</p>
  
  <pre><code>fields[i].style.borderColor = "red";
  </code></pre>
  
  <p>JavaScript code 2:</p>
  
  <pre><code>fields[i].style.border = "1px solid red";
  </code></pre>
  
  <p>If I use JS code 1, the border changes its color but it has the width bigger than before (even though I do not say anything about border width).
  If I use JS code 2, the text input shrinks with 2px and the change is noticeable.</p>
  
  <p>What should I do to change only the border color?</p>