Embed height Property - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Embed

Description

The height property sets or gets the height attribute in an <embed> element, which controls the height of the embedded content, in pixels.

Set the height property with the following Values

Value Description
pixels Sets the height of the embedded content in pixels

Return Value

A Number, representing the height of the embedded content, in pixels

The following code shows how to change the height of an embedded file to 500 pixels:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<embed id="myEmbed" src="helloworld.swf" width="200" height="200" style="border:1px solid">

<button onclick="myFunction()">Test</button>

<script>
function myFunction() {/*from   w w w .ja  v a2s . c o  m*/
    document.getElementById("myEmbed").height = "500";
}
</script>

</body>
</html>

Related Tutorials