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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:41:04+00:00 2026-05-24T18:41:04+00:00

i have few nested table with in datalist like <asp:DataList ID=dlList runat=server Width=50% onitemdatabound=dlList_ItemDataBound>

  • 0

i have few nested table with in datalist like

<asp:DataList ID="dlList" runat="server" Width="50%"
        onitemdatabound="dlList_ItemDataBound">
        <ItemTemplate>
            <table border="0px" id="tblOuter" cellpadding="0" cellspacing="0">
                <tr>
                    <td>
                        <table id="tblInner" border="0px" cellpadding="0" cellspacing="0">
                            <tr class="AccordionPanelTab">
                                <td class="QSHeader"><asp:Label ID="lblHead" runat="server"  Text='<%# Eval("QA") %>'></asp:Label></td>
                                <td align="right"><asp:Image ID="toggleImg" CssClass="ToggleImageStyle" runat="server" ImageUrl="Images/up-arrow.png" />
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr >
                    <td class="AccordionPanelContent"><div  id="content" runat="server" style="padding-left : 10px"></div></td>

                </tr>
            </table>
        </ItemTemplate>
    </asp:DataList>

so i was trying to access element when click on tr having class called “AccordionPanelTab”.

i wrote a jquery to access element like <div id="content">

<asp:Image ID="toggleImg" CssClass="ToggleImageStyle" runat="server" ImageUrl="Images/up-arrow.png" /> when user click on tr having class called "AccordionPanelTab".

my jquery is


this is not my actual jquery. here i am doing few trial & error for accessing element.

jQuery(document).ready(function () {
        $("tr.AccordionPanelTab").click(function () {
            alert($(this).parent().parent().attr("id"));
            alert($(this).parent().parent().closest("table").attr("id"));

        });
     })

but i am not being able to do so……..anyone can help. thanks

  • 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-24T18:41:05+00:00Added an answer on May 24, 2026 at 6:41 pm

    Try this.

    $(document).ready(function () {
        $("tr.AccordionPanelTab").live('click', function () {
            var imageID = $(this).find("img.ToggleImageStyle").attr("id");
            var contentID = $(this).closest("table").parent().parent().next().find("td.AccordionPanelContent div").attr("id");
            //alert("Image ID: " + imageID);
            //alert("Content ID: " + contentID);
        });
    });
    

    On an unrelated side note, please refrain from using id="tblOuter" and id="tblInner" inside the Data Presentation Control as it generates invalid HTML. ID should be used only once in an HTML document. Either use runat="server" or change it to class

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

Sidebar

Related Questions

I have a server-generated html like: <ul> <li><!-- few nested elements that form a
I have few nested DIVs at page. I want to add event only for
I have a page (telerik:RadPage) containing few grids and some nested controls and I
In general, I occasionally have a chain of nested macros with a few preprocessor
I have few different applications among which I'd like to share a C# enum.
We have few components like libraries dlls When initially created I ran the following
I have few nested DIV elements. For example: <div id='id1'><div id='id2'>content</div></div> I attach event
I have a few JPG Images. Some of them may have a black border
I have one table like this account_id (INT) inviter_id (INT) Now, logged in user
I have to print a 5x5 table with alphabets in them, like: <table> <tr>

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.