Input type image property height in Javascript
The Input type image property height used to set and retrieve the value of the height attribute of the input image. It returns a number that represents the height of the image input field.
Syntax
 1 <input>.height // to retrieve
 2 <input>.height = <number> // to set
input : A input type image element object to set and retrieve height property
number : It specifies the height of the image input field
Input image property height
 1 <!DOCTYPE html>
 2 <html>
 3 <style>
 4   .container {
 5     margin: 20px 0;
 6   }
 7   input {
 8   	width: 450px;
 9   	height: 200px;
 10   }
 11 </style>
 12 <body>
 13 	<h1>The Input Image Object</h1>
 14 	<h2>Example</h2>
 15 	
 16 	<div class="container">
 17 	  <button onclick="access()">
 18 	    <input id="img" src="image.png" type="image" 
 19 	      width="200" height="150" />
 20 	  </button>
 21 	</div>
 22 		
 23 	<p id="result"></p>
 24 	<script>
 25 	function access() {
 26 	  const element = document.getElementById("img");
 27 	  const str = `The image height : <b>${element.height}</b>`;
 28 	  document.getElementById("result").innerHTML = str;
 29 	}
 30 	</script>
 31 </body>
 32 </html>
Input image property height
Privacy Policy
Terms of Service
Disclaimer
Contact us
About us