Get Object Element - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Object

Introduction

The object represents an HTML <object> element.

You can access an <object> element by using getElementById():

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<object id="myObject" width="400" height="400" data="helloworld.swf">
</object>//from w ww  .j av  a2 s .  co m

<button onclick="myFunction()">get the URL of the embedded flash file</button>

<p id="demo"></p>

<script>
function myFunction() {
    var x = document.getElementById("myObject").data;
    document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>

Related Tutorials