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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:30:25+00:00 2026-05-20T10:30:25+00:00

I have repeated down the page an image with a div next to it

  • 0

I have repeated down the page an image with a div next to it like this:

 <img src="/img/productspage/questionMark.jpg" class="prodQuestionMark" />
            <div class="vuQuestionBubble">
                <p>this is where text for the text will go</p>
            </div>

vuQuestionBubble has a style display:none by default. when ‘prodQuestionMark’ is clicked i want the vuQuestionBubble next to it to show. ive put this code at the bottom.

$(document).ready(function () {
    $('.prodQuestionMark').click(function () {

        $(this).closest('vuQuestionBubble').show();
    });
});

it doesn’t seem to work… the click event is working and i can select the parent div with .parent but cant seem to interact with the closest div… any ideas?

  • 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-20T10:30:26+00:00Added an answer on May 20, 2026 at 10:30 am

    closest looks for ancestors, not siblings; also, your selector is missing a . at the beginning (you’re telling it to look for a vuQuestionBubble element, where you really mean a div with the class “vuQuestionBubble”).

    With your current structure, you can use next because the div with the “vuQuestionBubble” is the very next element. However, if you ever change your structure and put something between them, next won’t work for you.

    I’d probably use nextAll("div.vuQuestionBubble:first") or nextAll(".vuQuestionBubble:first") (links: nextAll, :first):

    $(document).ready(function () {
        $('.prodQuestionMark').click(function () {
    
            $(this).nextAll('div.vuQuestionBubble:first').show();
            // Or without `div`:
            //$(this).nextAll('.vuQuestionBubble:first').show();
        });
    });
    

    That will find the first div with the class “vuQuestionBubble” that follows the img as a sibling, even if it’s not the one right next to the img, and so makes your code less susceptible to maintenance issues if the markup changes slightly.

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

Sidebar

Related Questions

My problem is this. I have a DIV which replicates an image using CSS3.
I have a table with a lot of repeated data that I'd like to
I have the same block of code repeated with two different variables. This block
If i have this json response {error:repeated} Why the alert is not showed? It
I know that this is a repeated question. I have found very similar questions
I have a < div > in my aspx page which has some notification
I have a view file like this : <html> <head> <meta name=layout content=main />
I have this really weird bug. When I scroll down my table view, down
I have a fragment which pulls down data from a webservice and displays this
I have a this asp.net page which upon first time load: 1: Make a

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.