Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<h1>The Document Object</h1>
<h2>The images Property</h2>
<img src="klematis.jpg" alt="flower" width="150" height="120">
<img src="klematis2.jpg" alt="flower" width="150" height="120">
<p>The URL of the img element with id="myImg" is:</p>
<p id="demo"></p>
<script>
let src = document.images.namedItem("myImg").src;
document.getElementById("demo").innerHTML = src;
</script>
</body>
</html>