HTML Editor
<!DOCTYPE html> <html lang="en-US"> <head> <style> img{ width:250px; height:250px; } </style> </head> <body> <p>Click the following button to find the number of images in this document.</p> <button onclick="myFunction()">Click Me</button> <p id="point"></p> <img src="books.png" alt="myBooks"> <img src="apple-products.jpg" alt="myAppleProducts"> <script> var x = document.getElementById("point"); function myFunction(){ x.innerHTML = document.images.length; } </script> </body> </html>
OUTPUT
×

Save as Private