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

  • Home
  • SEARCH
  • 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 727155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T06:32:07+00:00 2026-05-14T06:32:07+00:00

OK, going rond in circles again – I’m sure the answer will be obvious.

  • 0

OK, going rond in circles again – I’m sure the answer will be obvious. Just not to me 🙂

I can’t seem to specify this as one target amongst a few targets for a function:

$(this, "elem1, elem2").doStuff()

I just want to doStuff() to a pair of elements, one of which is this. I can only get it to work if I explicitly name the elements, ie…

$("elem1, elem2, elem3").doStuff() 

…works fine. But I can’t seem to get it to work if I want to include this in the list. I have to write one line just for this, and another for elem1 elem2 etc.

All help greatly appreciated. Thanks.

  • 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-14T06:32:08+00:00Added an answer on May 14, 2026 at 6:32 am

    If I understand you correctly, you can use add() to add this to the jQuery object:

    $("#elem1, #elem2").add(this).doStuff();
    

    Or in reverse:

    $(this).add("#elem1, #elem2").doStuff();
    

    or even:

    $(this).add("#elem1").add("#elem2").doStuff();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Going to make an applications wich will be used on a device without a
Going through the Game Center / GameKit docs, I could not find any information
Just going to start making a web application and was wondering which was better,
Going back to my previous question on OCSP, does anybody know of reliable OCSP
While going through university and from following the development of SO, I've heard a
Been going over my predecessor's code and see usage of the request scope frequently.
After going through the Appendix A, C# Coding Style Conventions of the great book
What's going on here? printf.sh: #! /bin/sh NAME=George W. Bush printf Hello, %s\n $NAME
I'm going to start a new project - rewriting an existing system (PHP +
I am going to be using C/C++, and would like to know the best

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.