HOME HTML CSS JAVASCRIPT SQL PHP JQUERY XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

HTML Audio/Video DOM play() Method

HTML audio Tag Reference HTML Audio/Video DOM Reference

Example

A video with play and pause buttons:

var myVideo=document.getElementById("video1");
function playVid()
  {
  myVideo.play();
  }
function pauseVid()
  {
  myVideo.pause();
  }

Try it Yourself »

Definition and Usage

The play() method starts playing the current audio or video.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The play() method is supported in all major browsers.

Note: This method is not supported in Internet Explorer 8 and earlier.


Syntax

audio|video.play()


HTML audio Tag Reference HTML Audio/Video DOM Reference

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE