Get Embed Element - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Embed

Introduction

The Embed object represents an HTML <embed> element.

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

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<embed id="myEmbed" src="helloworld.swf">

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

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

<script>
function myFunction() {/*w  w w  .j a  v a  2 s  . c  om*/
    var x = document.getElementById("myEmbed").src;
    document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>

Related Tutorials