Object width Property - Change the height and width of an <object> element to 300px: - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Object

Description

Object width Property - Change the height and width of an <object> element to 300px:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<object id="myObject" width="250" height="200" data="helloworld.swf" style="border:1px solid black"></object>

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

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

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

</body>
</html>

Related Tutorials