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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:05:58+00:00 2026-05-14T02:05:58+00:00

Heres the markup: <div id=’0203′ class=’threadWrapper’> <div class=’littleme’> I am trying to send the

  • 0

Heres the markup:

<div id='0203' class='threadWrapper'>
<div class='littleme'>

I am trying to send the id of a parent div as a parameter in jquery.get function:

$('.littleme').click(function**()**{
var id = $(this).closest("div").attr("id");
$.get("PHP/viewedThread.php", {viewedURLID: id});
});

and am getting rather lost I’m afraid.

…ammendment…
$(this).closest(“.threadWrapper”).attr(“id”);

  • 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-14T02:05:58+00:00Added an answer on May 14, 2026 at 2:05 am

    I am guessing (not tested) that the closest is returning itself (“.littleme”) which without any id. If you need to target the parent div, try using parent or parents.


    UPDATE

    The Closest is acutally started from Current node, so, it is not going to look for parent but probably the next div follows.

    quote from documentation

    Get the first element that matches the selector, beginning at the current element and progressing up through the DOM tree

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

Sidebar

Related Questions

Can I do this without Javascript? Here is the mock markup.. <div id=parent> <div
Here's my tooltips markup and CSS: <div class=tooltip>Click here to like it</div> .tooltip {
here's my markup: <div class=container> <ul> <li class=record> <div class=item></div> <---- I am here
here is my markup: <div> <h3>Title</h3> <ul class=eventslist> <li>This event would be discarded</li> <ul>
I'm trying to use jquery to show and hide a div onclick, and, although
I'm trying to get img and the div which is coming after the div
heres what I'm currently using: Rails -v 3.2.3 I'm trying to make a path
I have the following DIV markup: <div id=dialog title=Membership Renewal> Your membership is going
I am currently trying to hook up jQuery UI dialog so that I may
Here is my markup CSS body{ background-color:#353535; } #parent{ background-color:#eee; } #child{ background-color:#1b1b1b; margin:60px

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.