当文件准备开始以HTML播放时执行脚本?
您可以将oncanplay 属性用于以下属性-<audio>,<embed>,<object>和<video>。
示例
<!DOCTYPE HTML>
<html>
<body>
<video width = "300" height = "200" controls oncanplay = "display()">
<source src = "/html5/foo.ogg" type = "video/ogg" />
<source src = "/html5/foo.mp4" type = "video/mp4" />
Your browser does not support the video element.
</video>
<script>
alert("我准备开始。");
</script>
</body>
</html>热门推荐
10 离别简短的祝福语大全
11 男朋友祝福语简短新年
12 年月日祝福语简短
13 老公开业祝福语简短
14 送给老师中秋祝福语简短
15 宝宝生日祝福语大全简短
16 给师父春节祝福语简短
17 理科元旦祝福语大全简短
18 简短的出行工作祝福语