Javascript language

adplus-dvertising
Increases and decreases the size of image using JavaScript
Previous Home Next

Step 1. Written below code in your application.

<html>
<script type="text/javascript">
function changeSize(x,y)
{
var x;
var y;
document.getElementById("compman").height=x;
document.getElementById("compman").width=y;
}
</script>
<body>
<img id="compman" src="Image.jpg" width="100" height="100" />
<br /><br />
<input type="button" onclick="changeSize(150,150)" value="150X150">
<br />
<input type="button" onclick="changeSize(200,200)" value="200X200">
<br />
<input type="button" onclick="changeSize(300,300)" value="300X300">
</body>
</html>

Step 2. Run the Application.

Previous Home Next