title: How to change border color of Bootstrap-select
body: <p>For a custom framework like Bootstrap select <a href="https://silviomoreto.github.io/bootstrap-select/" rel="nofollow">https://silviomoreto.github.io/bootstrap-select/</a> how do I change the border color of a select box in Javascript? </p>
  
  <p>I tried this but does not work. </p>
  
  <pre><code>document.getElementById("box").style.borderColor = "red";
  </code></pre>
  
  <p>Javascript</p>
  
  <pre><code>function validate() {
      var ok = true;
  
      var box = document.getElementById("box").value;
  
      if (!box) {
          document.getElementById("box").style.borderColor = "red";
          ok = false;
      } 
  
      return ok;
  }
  </code></pre>
  
  <p>HTML</p>
  
  <pre><code>&lt;form action="#" onsubmit="return validate()" method="POST"&gt;
      &lt;select id="box" name="num" class="selectpicker form-control"&gt;
        &lt;option value="" selected="selected"&gt;select number&lt;/option&gt;
        &lt;option value="1"&gt;1&lt;/option&gt;
        &lt;option value="2"&gt;2&lt;/option&gt;
      &lt;/select&gt;
  
      &lt;div class="text-center"&gt;
          &lt;button type="submit" class="btn btn-primary"&gt;submit&lt;/button&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>