title: Stop all HTML5 audio/video with JavaScript
body: <p>Trying to write a function that will pause all HTML5 audio and video.</p>
  
  <p>I've got this far, but I'm not sure if this is the correct way about it?</p>
  
  <pre><code>function stopAll() {
  var media = document.getElementsByClassName('media'),
      i = media.length;
  
  while (i--) {
      media[i].pause();
  }
  }
  </code></pre>
  
  <p><a href="http://jsfiddle.net/m6AkC/" rel="nofollow">http://jsfiddle.net/m6AkC/</a></p>