Home > Web Front-end > HTML Tutorial > How to use document.images in JavaScript?

How to use document.images in JavaScript?

WBOY
Release: 2023-08-19 15:49:02
forward
1093 people have browsed it

How to use document.images in JavaScript?

Use the document.images property in JavaScript to get the number of How to use document.images in JavaScript? tags in the document.

Example

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>
Copy after login

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!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template