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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T17:55:46+00:00 2026-06-02T17:55:46+00:00

I am using a modal system which displays content on click, i will use

  • 0

I am using a modal system which displays content on click, i will use it on a project that is integrated in a CMS but i would like to know if it is possible to use it with same structure, same id and class as below.

<div id="test">
    <a class="link" href="#">Link 1</a>
    <div id="basic-modal-content">
        Description 1
    </div>
</div>

<div id="test">
    <a class="link" href="#">Link 2</a>
    <div id="basic-modal-content">
        Description 2
    </div>
</div>  

I have tried the following jquery code, but it only works for the first one:

    $('#test').click(function (e) {
    $(this).find('#basic-modal-content').modal();

    return false;
});

I think there can be some trick or something, without the need of attending each modal an id/class dynamically. If there is a selector that will help me, please let me know.

Thanks for reading about my issue.

  • 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-02T17:55:48+00:00Added an answer on June 2, 2026 at 5:55 pm

    Don’t use ID’s unless it’s going to be a unique element. Use classes instead. If you’re selecting something using an ID, the jQuery object returned will refer only to the first one it finds, hence why ID’s should only be used on unique items.

    Let me rephrase that better. ID’s should be unique. It’s fine to have ID’s on elements that aren’t unique, but that same ID shouldn’t be used anywhere else on the page.

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

Sidebar

Related Questions

What are the best practices for using use cases to model system behavior that
I am using AJAX modal popup in my project, but there is problem with
I have a system which is using Spring for dependency injection. I use annotation-based
I am currently in the process of designing a system which will use multiple
how can I open a modal window using javascript only. I can't use own
I am using a System.Windows.Forms.Timer component on an application's main form which checks every
I have a table that, due to the third party system we are using,
I have two views which will both use the same Controller method: //webServiceController.cs //The
I'm starting to creat this project using MVVM Model. But I have no idea
My domain model is using System.Net.Uri to represent URLs, and System.Drawing.Color to represent colors.

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.