运行 ❯
获取您
自己
的网站
×
更改方向
保存代码
更改主题,深色/浅色
前往空间
<!DOCTYPE html> <html> <body> <form id="form1"> An Example Form: <input type="text" name="exampleform"> </form> <object id="myObject" data="helloworld.swf" width="200" height="200" name="obj1" form="form1"></object> <p>Click the button to display the id of the form the object element belongs to.</p> <button onclick="myFunction()">Try it</button> <p id="demo"></p> <script> function myFunction() { var x = document.getElementById("myObject").form.id; document.getElementById("demo").innerHTML = x; } </script> </body> </html>