Javascript DOM HTML Embed height and width set

Introduction

Change the height and width of an embedded file to 100 pixels:

Click the button to change the height and width of the animation to 100 pixels.

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>

<script>
function myFunction() {//from ww  w .j a  v  a 2  s . c  om
  document.getElementById("myEmbed").height = "100";
  document.getElementById("myEmbed").width = "100";
}
</script>

</body>
</html>



PreviousNext

Related