How can I pause ALL videos (html5) at once?
There's no real need for jQuery, the ES6 way (that should work in most modern browsers...)
For all <video>
tags:
document.querySelectorAll('video').forEach(vid => vid.pause());
or in your case (looking for the .vid
class):
document.querySelectorAll('.vid').forEach(vid => vid.pause());
Try
$('.vid').each(function() {
$(this).get(0).pause();
});