Javascript DOM HTML Embed height Property get

Introduction

Return the height of an embedded file:

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

Click the button to return the height of the animation.

View in separate window

<!DOCTYPE html>
<html>
<body>

<embed id="myEmbed" src="video.mp4" width="200" height="200" style="border:1px solid">
<button onclick="myFunction()">Test</button>

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

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

</body>
</html>



PreviousNext

Related