$(document).ready(function() { $(".myvideos").on("mouseover", function(event) { this.play(); }).on('mouseout', function(event) { this.pause(); }); })