首页
极刻
圈子
教程
开源
极客社区
写文章
发极刻
建圈子
发项目
登录 / 注册
返回教程:Javascript 参考手册
TRY RUN / 在线示例
Javascript 参考手册 尝试一下
Javascript 参考手册 尝试一下
源代码
运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>安科教程(www.ancii.com)</title> </head> <body> <video id="myVideo"> <source id="mp4_src" src="/statics/demosource/mov_bbb.mp4" type="video/mp4"> <source id="ogg_src" src="/statics/demosource/mov_bbb.ogg" type="video/ogg"> 您的浏览器不支持 video 标签。 </video> <p>点击按钮播放或暂停视频。</p> <button onclick="playVid()" type="button">播放视频</button> <button onclick="pauseVid()" type="button">暂停视频</button> <script> var x = document.getElementById("myVideo"); function playVid(){ x.play(); } function pauseVid(){ x.pause(); } </script> <p>视频由<a href="http://www.bigbuckbunny.org/" target="_blank">Big Buck Bunny</a>提供。</p> </body> </html>
运行结果