title: Create element for each div with a particular class
body: <p>I have a couple of divs with a "isVideo" class. I can successfully attach a click event with a for loop, but I also need to create a span within each div. This is what I have:</p>
  
  <pre><code>var videos = document.getElementsByClassName("isVideo");
       for (var i = 0; i &lt; videos.length; i++) {
       videos[i].addEventListener('click', playVideo, false);
       var playBtn =  videos[i].createElement("span");
       playBtn.appendChild(videos[i]);
  }
  </code></pre>
  
  <p>codepen: <a href="http://codepen.io/garethj/pen/bpxVKX" rel="nofollow">http://codepen.io/garethj/pen/bpxVKX</a></p>