Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Initiate play event on click
// jQuery version - we use the .on() function to make sure we can also run the function on dynamically inserted elements.
$(document).on("click", "a.playbtn", function (e) {
var video = $(document).find('#intro-video')[0]; // Find the video element to play
video.play(); // play the video, simple innit?
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment