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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:00:57+00:00 2026-05-25T19:00:57+00:00

Multiple selectors are used with delegate using the following: $(contextElement).delegate(‘selector1, selector2’ , ‘eventName’, function(){

  • 0

Multiple selectors are used with delegate using the following:

$(contextElement).delegate('selector1, selector2' , 'eventName', function(){ //blabla });

In larger projects where managing DOM elements becomes crucial, storing the elements in variables that are binded to the window object becomes an attractive way to work.

However I can’t join this way of working with using multiple selectors on the delegate method:

window.someControl = {
     contextElement = $('selector0'),
     DOMasProperty1 = $('selector1'),
     DOMasProperty2 = $('selector2')
}

someControl.contextElement.delegate(
'you magic answer for using DOMasProperty1 
and DOMasProperty2', 
'click', 
function(){ 

  //blabla 

});

Note: I am aware that the string value of the selector as oppose to its jQuery object can be stored in the someControl object. However I am storing the jQuery objects to improve the performance of the code and simply calling the string values over and over again will make this way of working not different to simply using the selector name wit the method.

I need an answer to somehow combine the use of delegate with reducing DOM lookups

  • 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-05-25T19:00:59+00:00Added an answer on May 25, 2026 at 7:00 pm

    jQuery objects have a .selector property that will refer to your original selector.

    someControl.contextElement.delegate(
        window.someControl.DOMasProperty1.selector + ',' + 
        window.someControl.DOMasProperty2.selector,
        'click', 
        function(){ 
    
              //blabla 
    
        });
    

    Note that it will work for:

    DOMasProperty1 = $('selector1'),
    

    …but probably not if you include DOM traversal methods like:

    DOMasProperty1 = $('selector1').parent(),
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know you can combine multiple table-selects using a Join statement but is there
I have the following markup that is used to produce a pop-up style mega-menu
How can I access Objects when there are multiple objects are returned when using
I have used the following code to create a new thread: [NSThread detachNewThreadSelector:@selector(backgroundMethod:) toTarget:self
I have a set of classes that are used multiple times on a page
What is the proper CSS syntax for applying multiple pseudo classes to a selector.
I have multiple selects: <select id=one> <option value=1>one</option> <option value=2>two</option> <option value=3>three</option> </select> <select
Below is my $.ajax call, how do I put a selects (multiple) selected values
Handling multiple merges onto branches in Subversion or CVS is just one of those
Often multiple applications share a large codebase of libraries that change often in development.

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.