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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T14:53:57+00:00 2026-06-07T14:53:57+00:00

I have a question towards design of my application, it is a big project

  • 0

I have a question towards design of my application, it is a big project that contains the following example javascripts:

  • modal.js (contains a jQuery plugin for modal forms)
  • tooltip.js (contains a jQuery plugin for tooltips)
  • textbox.js (contains a jQuery plugin for textboxes, placeholders etc.)

Would it hurt performance if I would use data-api to set up my whole javascript ui, so I would loop through all elements with this code and initialize a plugin if needed:

$.each('[data-trigger="modal"]', function(a, b){
  // Do plugin code here $(this).modal()
});

$.each('[data-textbox="^*"]', function(a, b){
  // Do plugin code here $(this).textbox()
});

$.each('[data-tooltip="hello, I am a tooltip"]', function(a, b){
  // Do plugin code here $(this).tooltip()
});

The other option would be:

$(document).ready(function(){
  $('#modal-create-account-trigger').modal();
  $('#tb-username').textbox();
  $('#tb-password').textbox();
  $('#tb-fullname').textbox();
});

I prefer the .each solution, so we can control it all fully in the HTML, how ever I know this is bad for performance, how bad is it, and are there alternatives?

Thanks alot for reading.

  • 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-07T14:53:58+00:00Added an answer on June 7, 2026 at 2:53 pm

    It’s always better to use #ID selectors due to huge performance gain.

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

Sidebar

Related Questions

I'm looking for some db design help. I have an existing application that I'd
I have Question and QuestionTypes. In Question table there is a foreign key that
I have question related to what is done in SMS application is if i'm
This question is geared towards MySQL, since that is what I'm using -- but
This is a question towards programmers who have experience with using Visual Studio 2010
Background I have a personal project that I've been trying to build for around
I have a question, less pertaining to actual implementation more towards how it works.
This question is more towards Design and Architecture and I want to know SO
We are currently working on the design of a RESTful application. We have decided
I have been assigned a project to develop a set of classes that act

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.