Home > Article > Web Front-end > How to use document.images in JavaScript?
Use the document.images property in JavaScript to get the number of tags in the document.
You can try running the following code to implement the document.images property in JavaScript.
Real-time demonstration
<!DOCTYPE html> <html> <head> <title>JavaScript Example</title> </head> <body> <h1>TutorialsPoint Tutorials</h1> <img src="/javascript/images/javascript-mini-logo.jpg"/ alt="How to use document.images in JavaScript?" ><br> <img src="/html5/images/html5-mini-logo.jpg"/ alt="How to use document.images in JavaScript?" > <script> var num = document.images.length; document.write("<br>How many images? "+num); </script> </body> </html>
The above is the detailed content of How to use document.images in JavaScript?. For more information, please follow other related articles on the PHP Chinese website!