Javascript examples for DOM HTML Element:Input Image
The Input Image object represents an HTML <input> element with type="image".
You can access an <input> element with type="image" by using getElementById():
<!DOCTYPE html> <html> <body> <input type="image" src='http://java2s.com/resources/a.png' id="myImage" > <button onclick="myFunction()">test</button> <p id="demo"></p> <script> function myFunction() {// ww w . ja v a2 s.co m var x = document.getElementById("myImage").src; document.getElementById("demo").innerHTML = x; } </script> </body> </html>