<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>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_object_form by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 03:17:46 GMT -->
</html>