<!DOCTYPE html>
<html>
<body>
<img src="klematis.jpg" alt="flower" width="150" height="113">
<img src="klematis2.jpg" alt="flower" width="152" height="128">
<img src="smiley.gif" alt="Smiley face" width="42" height="42">
<p>Click the button to display the number of images in the document.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.images.length;
document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>