Set image height : Image Img « HTML « JavaScript DHTML






Set image height

  

<html>
<head>
<title></title>
<script type="text/javascript">
function procImage() {
   var img = document.images[0];
   var imgAttr = img.align + " " + img.alt + " " + img.src + " " + img.width + " " + img.height;
   alert(imgAttr);

   img.src="http://www.java2s.com/style/logo.png";
   img.width="100";
   img.height="100";
   img.alt="Alternative";
   img.align="left";
   img.title="Upright";
   
   imgAttr = img.align + " " + img.alt + " " + img.src + " " + img.width + " " + img.height;


   alert(imgAttr);
   document.close();
} 
</script>
<body onload="procImage();">
<img src="asdf.gif" alt="asdf" />
</body>
</html>

   
    
  








Related examples in the same category

1.Get the file name specified in the href or src property
2.Image dynsrc
3.Low resolution Image src
4.Image Long Description
5.Image width Example
6.Does image download completely
7.Alternative Information Example
8.Image align Example
9.Image 'src' Property
10.'height' Example
11.'readyState' Example
12.'galleryImg' Example
13.Monitors the load process and the display of pictures
14.Image Animation
15.Image array
16.Replace image
17.An animating image
18.Mouse in image and out
19.Scrolling Image
20.Change the height of an image
21.Change image
22.Change image width
23.Count images in a document
24.Image Event Handling
25.Methods and Properties of the Image Object
26.Testing an Image's align Property
27.A Scripted Image Object and Rotating Images
28.Scripting image.complete
29.Changing Between Still and Motion Images
30.Simple Image Replacement
31.Image Error Finder
32.Image element
33.Image Roller Machine
34.Change image in mouse in and out event
35.Use array to store the image names
36.Img onmouseover and onmouseout actions
37.Change vspace for image
38.Change image src
39.Set image alt message
40.Change image align
41.Change image title