title: Change color of navbar using javascript
body: <p><strong>HTML</strong></p>
  
  <pre><code>   &lt;nav&gt;
      &lt;ul&gt;
          &lt;li&gt;&lt;a class="notDrop" href="#home"&gt;HOME&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a class="notDrop" href="guides.html"&gt;GUIDES&lt;/a&gt;&lt;/li&gt;
          &lt;li class="dropdown"&gt;
              &lt;a class="dropbtn"&gt;BRANDS&lt;/a&gt;
                      &lt;div class="dropdown-content"&gt;
                      &lt;a href="gaming.html"&gt;NVIDIA&lt;/a&gt;
                      &lt;a href="#"&gt;INTEL&lt;/a&gt;
                      &lt;a href="#"&gt;CORSAIR&lt;/a&gt;
                      &lt;a href="#"&gt;SAMSUNG&lt;/a&gt;
              &lt;li class="dropdown"&gt;
                  &lt;a class="dropbtn"&gt;BUILDS&lt;/a&gt;
                      &lt;div class="dropdown-content"&gt;
                      &lt;a href="gaming.html"&gt;GAMING&lt;/a&gt;
                      &lt;a href="#"&gt;OFFICE&lt;/a&gt;
                      &lt;a href="#"&gt;SERVER&lt;/a&gt;
                      &lt;a href="#"&gt;MEDIACENTER&lt;/a&gt;
                      &lt;/div&gt;
              &lt;/li&gt;
      &lt;/ul&gt;
  &lt;/nav&gt;
  </code></pre>
  
  <p><strong>CSS</strong></p>
  
  <pre><code>    nav {
      background-color: white;
      overflow: hidden;
      display: flex;
      justify-content: center;
  }
  </code></pre>
  
  <p><strong>Javascript</strong></p>
  
  <pre><code>    window.onload = function mobile(){
      if( isMobile.any() ) {
          document.getElementById('nav').style.backgroundColor = "blue";
         alert('Mobile'); 
      }
  }
  </code></pre>
  
  <blockquote>
    <p>But I can't get it to change color, what am I doing wrong? I managed
    to change the color of the body but I cant of the nav.</p>
  </blockquote>