title: getElementByID returns null (jsfiddle inside)
body: <p>I'm trying to create custom buttons for a media player. The tricky part is that I want the play button to become a "loading" button that will later become a pause button but anyways.</p>
  
  <p>I'm using 4 <code>div</code>s - <code>stop</code> / <code>play</code> / <code>loading</code> / <code>pause</code>, the last two being hidden (display:none;). I want to display the loading div instead of the play div when you click on the latter (in addition to activating the player). Yet when I call <code>lyricsPlay("B")</code>,<code>document.getElementById("lyrics" + el + "1")</code> seems to be returning null.</p>
  
  <p>The stop button closes the container <code>div</code> (a popup which will contain the player), and stops the player. This part works fine.</p>
  
  <p>Being pretty much a newbie when it comes to javascript, I'm sure this is a stupid mistake on my part but I'm at a complete loss in finding where it is. I've read many posts about <code>getElementById()</code> returning null but none of the solutions seems to apply to my case.</p>
  
  <p>Below is my HTML code, but you can fiddle with it <a href="http://jsfiddle.net/kX83R/1/" rel="nofollow noreferrer">here</a>:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function lyricsToggle(div_id) {
    var el = document.getElementById(div_id);
    if (el.style.display == 'none') {
      el.style.display = 'block';
    } else {
      el.style.display = 'none';
    }
  }
  
  function lyricsStop(videoID, divID) {
    lyricsToggle(divID);
    //jQuery('#lyrics' + videoID).tubeplayer('stop');
  }
  
  function lyricsPlay(el) {
    var play = document.getElementById("lyrics" + el + "1"); //returns null??
    var load = document.getElementById("lyrics" + el + "2"); //returns null??
    lyricsToggle(play);
    lyricsToggle(load);
    //jQuery(video).tubeplayer("play");
  }</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>#container {
    margin-top: 60px;
    margin-right: 100px;
  }
  
  .lyricsPlay {
    width: 30px;
    height: 30px;
    float: right;
    background-color: green;
  }
  
  .lyricsStop {
    width: 30px;
    height: 30px;
    float: right;
    background-color: red;
  }
  
  .lyricsLoad {
    width: 30px;
    height: 30px;
    float: right;
    display: none;
    background-color: blue;
  }
  
  .lyricsPause {
    width: 30px;
    height: 30px;
    float: right;
    display: none;
    background-color: yellow;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;body&gt;
    &lt;div id="container"&gt;
  
      &lt;div id="lyricsB0" class="lyricsStop" onClick="lyricsStop('B', 'container')"&gt;
        stop
      &lt;/div&gt;
  
      &lt;div id="lyricsB1" class="lyricsPlay" onClick="lyricsPlay('B')"&gt;
        play
      &lt;/div&gt;
  
      &lt;div id="lyricsB2" class="lyricsLoad" onClick="lyricsLoad('B')"&gt;
        loading
      &lt;/div&gt;
  
      &lt;div id="lyricsB3" class="lyricsPause" onClick="lyricsPause('B')"&gt;
        pause
      &lt;/div&gt;
  
    &lt;/div&gt;
  &lt;/body&gt;</code></pre>
  </div>
  </div>
  </p>