Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to work with document.images in JavaScript?
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>Advertisements