Use the document.images property in JavaScript to get the number of <img> tags in a document.
Example
You can try to run the following code to implement document.images property in JavaScript.
<!DOCTYPE html> <html> <head> <title>JavaScript Example</title> </head> <body> <h1>TutorialsPoint Tutorials</h1> <img src="/javascript/images/javascript-mini-logo.jpg"/><br> <img src="/html5/images/html5-mini-logo.jpg"/> <script> var num = document.images.length; document.write("<br>How many images? "+num); </script> </body> </html>