WordPress.org

Ready to get started?Download WordPress

Forums

Help Javascript... (1 post)

  1. j25shl
    Member
    Posted 7 years ago #

    Please help on javascript.
    I have a post contains couple of images. And I want to count how many images the post contains and display it.
    When I use
    document.images.length
    it returns all image numbers, not only inside post but header, footer, and other images too.

    When page DOM structure looks like this:

    #page
     #header
     #main
      #maincontent
      #mainside
     #footer

    How can I count image numbers only inside a post?

Topic Closed

This topic has been closed to new replies.

About this Topic