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>