The height
attribute of the embed element
specifies the height of the embedded content, in pixels.
The height
property sets or gets the height attribute in an <embed> element.
height |
Yes | Yes | Yes | Yes | Yes |
Return the height property.
var v = embedObject.height
Set the height property.
embedObject.height=pixels
Value | Description |
---|---|
pixels | Set the height of the embedded content in pixels |
A Number type representing the height of the embedded content in pixels.
The following code shows how to change the height of an embedded file to 200 pixels.
<!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() { document.getElementById("myEmbed").height = "200"; } </script> </body> </html>
The following code shows how to get the height of an embedded file.
<!DOCTYPE html> <html> <body> <embed id="myEmbed" src="notExist.swf" width="200" height="200" style="border:1px solid"> <p id="demo"></p> <button onclick="myFunction()">test</button> <script> function myFunction() { var x = document.getElementById("myEmbed").height; document.getElementById("demo").innerHTML = x; } </script> </body> </html>