Change image width : Image Img « HTML « JavaScript DHTML
- JavaScript DHTML
- HTML
- Image Img
Change image width
<html>
<head>
<script type="text/javascript">
function setWidth(){
var x=document.images
x[0].width="300"
}
</script>
</head>
<body>
<img src="http://www.java2s.com/style/logo.png" width="107" height="98" />
<form>
<input type="button" onclick="setWidth()" value="Change Width">
</form>
</body>
</html>
Related examples in the same category