Get Object Element - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Object


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>

<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>

function myFunction() {
    var x = document.getElementById("myObject").data;
    document.getElementById("demo").innerHTML = x;


Related Tutorials