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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:50:32+00:00 2026-05-25T11:50:32+00:00

How would you utilize the jQuery simple modal box, for multiple instances on one

  • 0

How would you utilize the jQuery simple modal box, for multiple instances on one page, with unique content for each description??

Would I use the .this function?

html:

    <div id='class-descriptions'>
      <a href='#' class='basic'>Description 1</a>
      <a href='#' class='basic'>Description 2</a>
      <a href='#' class='basic'>Description 3</a>
      <a href='#' class='basic'>Description 4</a>
    </div>

<div id="description1">description 1 content</div>
<div id="description1">description 2 content</div>
<div id="description1">description 3 content</div>
<div id="description1">description 4 content</div>

js:

jQuery(function ($) {
    // Load dialog on page load
    //$('#description').modal();

    // Load dialog on click
    $('#class-descriptions .class').click(function (e) {
        $('#description1').modal();

        return false;
    });
});
  • 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-25T11:50:33+00:00Added an answer on May 25, 2026 at 11:50 am

    The first thing that you need to know it’s fix the html code, you cannot use the same id for the divs, also you need to bind in some way the element a with the element div which have the content

    <div id='class-descriptions'>
      <a href='#' id="description-1" class='basic'>Description 1</a>
      <a href='#' id="description-2" class='basic'>Description 2</a>
      <a href='#' id="description-3" class='basic'>Description 3</a>
      <a href='#' id="description-4" class='basic'>Description 4</a>
    </div>
    
    <div id="content-1">description 1 content</div>
    <div id="content-2">description 2 content</div>
    <div id="content-3">description 3 content</div>
    <div id="content-4">description 4 content</div>
    

    Assuming that each element a it’s refered to each div that would be a modal, maybe the code should be like this

    $(document).ready(function (){
        $('#class-descriptions .basic').click(function (e) {
            var aux = $(this).attr('id');
            aux = aux.replace('description','content');
            $(aux).modal();
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to utilize the ASP.NET AJAX Page Methods functionality with a user
I'm trying to write a Greasemonkey script, and would like to use the jQuery
I'm playing with an idea of creating client that would use the torrent protocol
While developing a design using jQuery I stumbled across a problem. How would I
So I recently wanted to use the jQuery to do some browser detection and
I am writing a graphics library in C and I would like to utilize
DroidFu and GreenDroid are great open source projects which I would like to utilize
I'm looking to utilize jQuery's UI plugin to create draggable() and droppable() behavior similar
I'm looking to rewrite a pretty intensive CRUD type ASP.NET page to utilize ajax
I would like to utilize classes that inherit the System.Data name space. Specifically, I

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.