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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:03:10+00:00 2026-06-03T01:03:10+00:00

I am trying to select a group of elements with a similar class. and

  • 0

I am trying to select a group of elements with a similar class. and then filter the selection by the element id. Is there a better way to go about this?

Then using that same id, I want to do something to a element set up with the same show entitcal class

$('ElementClass-1').attr('ElementId-1');
   $(this).hover(function(){
        ..do stuff
       });
  });

<a class="ElementClass-1" id="ElementId-1">hover me</a>
<a class="ElementClass-1" id="ElementId-2">hover me</a>
<a class="ElementClass-1" id="ElementId-3">hover me</a>
<div style="display:none; class="ElementId-1">show me</div>
<div style="display:none; class="ElementId-2">show me</div>
<div style="display:none; class="ElementId-3">show me</div>
  • 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-03T01:03:13+00:00Added an answer on June 3, 2026 at 1:03 am

    Try something like below,

    $(ElementClass).each(function () {
        $('.' + this.id).<your_function>();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to group related elements using class name. They, in turn, are all
I'm trying to select an H1 element which is the second-child in its group
I am trying to select elements based on a number in their title element
I trying to select all li elements at second level of the list add
In trying to select elements that have any attributes, the following throws a jQuery
I am trying to select only the topmost section H1s. In this fiddle ,
I am trying to select an object from this array and print all of
I'm trying to select all dom elements that have id=mydiv but exclude the ones
I am trying to select a certain value from a multi-element background-image property such
I'm trying to select a value in a select element. I'm using Selenium RC

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.