Javascript examples for DOM HTML Element:Object
The height property sets or gets the height attribute of an <object> element, which sets the height of an object, in pixels.
Set the height property with the following Values
Value | Description |
---|---|
pixels | Sets the height of the object, in pixels (e.g. height="100") |
A Number, representing the height of the object, in pixels
The following code shows how to change the height of an <object> element to 400px:
<!DOCTYPE html> <html> <body> <object id="myObject" width="250" height="200" data="helloworld.swf"></object> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {/* ww w . j a v a 2 s . c o m*/ document.getElementById("myObject").height = '300'; document.getElementById("demo").innerHTML = 'changed'; } </script> </body> </html>