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 9245393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:15:28+00:00 2026-06-18T09:15:28+00:00

I need to do quite a few HTML manipulation using jQuery on a site

  • 0

I need to do quite a few HTML manipulation using jQuery on a site where there are hundreds of products displayed in the same structures. Pretty much the blocks of codes are each individually wrapped in a div container with an identical class name.

Now I am wondering if I should insert an unique ID to the class name so I can use $(‘#ID’) instead of $(‘.class’) for HTML manipulation. Getting the idea from this article #3.

I will probably use a for loop to insert an id after the class to create the IDs. Is this worth the time? More importantly is it going to help the performance?

Edit:
For the type of manipulation I am going to do, for loops will be used quite often for sure.
Also, I am not quite sure if pagination means anything to the performance at all. Now the products are displayed 10 per page, the user has options to see more per page.

  • 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-18T09:15:29+00:00Added an answer on June 18, 2026 at 9:15 am

    Yes, ID selectors are much more efficient. Use them to narrow down your scope, and then you can select by class later on. Also, save selections that might be reused.

    var container = $("#someId");
    var products = container.find(".product");
    
    //later on...
    
    products.find(".class").doSomething();
    

    Also, keep in mind that .children() is more efficient than .find() – so use that when possible.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am quite new to Jquery and need help trying to get a few
I have written quite a few Ruby programs, but if I need to show
I'm quite new to develop on GAE. Need just sort out few questions about
I need CEDET for eassist ( eassist-list-methods is quite handy). In eassist.el there's the
Disclaimer: I know there are quite a few questions out there with this topic
I can imagine that there might be quite a few of them depending on
There are quite a few questions here on SO about the following meta tag
I need to render quite alot (tens of thousands) images off-screen using OpenGL. I
Quite a few examples I see of using knockout when showing a list of
We have quite a few validation methods that need to access repositories / database

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.