Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8019987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:33:37+00:00 2026-06-04T21:33:37+00:00

Here is a jQuery issue that I come across and always have to resolve

  • 0

Here is a jQuery issue that I come across and always have to resolve using methods I’m not proud of.

I’m attempting to store a collection of elements for later assessment. The problem is that every time I try to access and apply any function to it, the error console reports the it is not a function. I’m convinced that I have a misunderstand of how jQuery works. Nonetheless, I’d like to be pointed in the right direction. Here is the code I am using:

var products = $('ul.products');
var productLists = []
$.each(products, function (i) {
    productLists[i] = products[i].children('li');
    console.log(productLists[i]);
});

and here is the error I get:

Uncaught TypeError: Property 'children' of object #<HTMLUListElement> is not a function
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T21:33:39+00:00Added an answer on June 4, 2026 at 9:33 pm

    You’re attempting to call a jQuery method off an HTMLElement. Try wrapping the element reference in a new jQuery object:

    productLists[i] = $(products[i]).children('li');
    

    Within $.each, you can use the keyword this to reference the current item being handled. So instead of calling products[i], you could just as easily say this:

    $.each( products, function() {
      productsList.push( $(this).children("li") );
    });
    

    Note also that jQuery already stores a collection of references to elements when you make a selection:

    var productList = $("ul.products li"); // All list items in ul.products
    

    You can then manipulate all of these as you wish later. If you need your own copies of them, to ensure they will exist later when you want to tamper with them, you can use .clone:

    var productList = $("ul.products li").clone();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have done drag and drop using with jquery. here i have issue that
Here's my issue - I need to dynamically download several scripts using jQuery.getScript() and
I have a rather annoying cosmetic issue with jQuery. I'm using the $(window).scroll event
I have a login form using jquery ajax and a php code. The issue
I have two navigation arrows (transparent pngs) that fade in/out (using jQuery fadeIn() and
hi i have a function that worked fine using jQuery 1.3.2 but now i
I have a simple page here to demonstrate the issue that I am seeing.
My issue here is quite simple : i'm trying to use the jQuery validate
Fairly new to Jquery here.... but one thing I have been told and being
I am using the superfish plugin for jquery here: clicky it works fine in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.