(function($) { $(document).ready(function() { $(‘.et_pb_video_overlay’).click(function() { var iframe = $(this).prev(‘.et_pb_video_box’).find(‘iframe’), iframe_src = $(iframe).attr(‘src’); $(iframe).attr(‘src’, iframe_src + ‘&autoplay=1&rel=0’); //****Added youTube rel=0 argument to hide related videos after video finishesplaying ****// $(‘.et_pb_video_overlay’).css(‘display’,’none’); //****This hides the overlay ****// }); }); })(jQuery);