简单教程
提交运行
代码编辑器:
<button onclick="enableMute()" type="button">静音</button> <button onclick="disableMute()" type="button">启动音效</button> <button onclick="checkMute()" type="button">检查静音状态</button> <br> <video id="video1" controls="controls"> <source src="/static/i/html/html_video_1.mp4" type="video/mp4"> <source src="/static/i/html/html_video_1.ogg" type="video/ogg"> 您的浏览器不支持 HTML5 video 标签。 </video> <script> myVid=document.getElementById("video1"); function enableMute() { myVid.muted=true; } function disableMute() { myVid.muted=false; } function checkMute() { alert(myVid.muted); } </script> <p>Video courtesy of <a href="http://www.bigbuckbunny.org/" target="_blank">Big Buck Bunny</a>.</p> <footer>简单教程,简单编程<br/>Copyright © 简单教程 www.twle.cn</footer>
运行结果: