<!DOCTYPE html> <html> <body> <h1>演示如何访问 OBJECT 元素</h1> <object id="myObject" width="641" height="360" data="/static/demo/video/shanghai.mp4"> </object> <p>单击该按钮可获取嵌入式视频文件的 URL。</p> <button onclick="myFunction()">试一试</button> <p id="demo"></p> <script> function myFunction() { var x = document.getElementById("myObject").data; document.getElementById("demo").innerHTML = x; } </script> </body> </html>