Javascript DOM HTML Object height Property get

Introduction

Get the height of an <object> element:

var x = document.getElementById("myObject").height;

Click the button to display the height of the object element.

View in separate window

<!DOCTYPE html>
<html>
<body>

<object id="myObject" width="100" height="100" data="video.mp4"></object>

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

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

<script>
function myFunction() {/*from   www  .  java2 s .c  o m*/
  var x = document.getElementById("myObject").height;
  document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>



PreviousNext

Related