<!DOCTYPE html>
<html>
<body>
<img id="myImg" src="w3javascript.gif" width="100" height="132">
<br>
<button type="button" onclick="myFunction()">Change height and width of image</button>
<script>
function myFunction() {
document.getElementById("myImg").style.height = "300px";
document.getElementById("myImg").style.width = "300px";
}
</script>
</body>
</html>