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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T14:11:32+00:00 2026-05-24T14:11:32+00:00

I have a generated jqueryui accordion code like this: <div id=treeview-accordion> <h3><a href=# accindex=0>Basic</a></h3>

  • 0

I have a generated jqueryui accordion code like this:

<div id="treeview-accordion">
<h3><a href="#" accindex="0">Basic</a></h3>
<div>
    <ul class="navigation-treeview treeview-sanjo" id="yw0">
        <li><span style="font-weight:bold"><a href="/sanjo/site/index"> Home</a></span>
            <ul>
                <li><span> Profile</span>
                    <ul>
                        <li><span><a href="/sanjo/user/profile"> View Profile</a></span></li>
                        <li><span><a href="/sanjo/user/profile/edit"> Update Profile</a></span></li>
                        <li><span><a href="/sanjo/user/profile/changepassword"> Change Password</a></span></li>
                    </ul>
                </li>
            </ul>
        </li>
        <li><span> Personnel Management</span>
            <ul>
                <li><span><a href="/sanjo/user/admin"> Manage Personnel</a></span>
                <ul>
                    <li><span><a href="/sanjo/user"> List Personnel</a></span></li>
                    <li><span> Add Personnel</a></span></li>
                </ul>
                </li>
            </ul>
        </li>
    </ul>
</div>
<h3><a href="#" accindex="0">Basic2</a></h3>
<div>
    <ul class="navigation-treeview treeview-sanjo" id="yw01">
        <li><span style="font-weight:bold"><a href="/sanjo/site/index2"> Home2</a></span>
            <ul>
                <li><span> Profile</span>
                    <ul>
                        <li><span><a href="/sanjo/user/profile2"> View Profile2</a></span></li>
                        <li><span><a href="/sanjo/user/profile/edit2"> Update Profile2</a></span></li>
                        <li><span><a href="/sanjo/user/profile/changepassword2"> Change Password2</a></span></li>
                    </ul>
                </li>
            </ul>
        </li>
        <li><span> Personnel Management2</span>
            <ul>
                <li><span><a href="/sanjo/user/admin2"> Manage Personnel2</a></span>
                <ul>
                    <li><span><a href="/sanjo/user2"> List Personnel2</a></span></li>
                    <li><span> Add Personnel2</a></span></li>
                </ul>
                </li>
            </ul>
        </li>
    </ul>
</div>

and what I want to achieve is to get the attribute “accindex” of the appropriate ‘h3’ tag depending on the link clicked.

For example,I clicked on “View Profile”, and since it is located under the “h3” (Basic), I want to get the value of its accindex attribute, which is “0”.

I tried to use closest(), but it is returning “undefined”. I can’t use parents() either.

How could I accomplish such task? Kindly help me out.

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-24T14:11:33+00:00Added an answer on May 24, 2026 at 2:11 pm

    First of all “View Profile” link is not inside h3, its in the sibling of h3. Try this

    When you click on view profile link try this

    accindex = $(this).closest("div").prev("h3").find("a").attr("accindex");
    

    Note: In the above code this represents the anchor which is clicked.

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

Sidebar

Related Questions

I have the following tabs on certain div on my page: (this code is
I have this markup dinamically generated through PHP/MySQL <div id=sortable> <h3>Italy</h3> <ul> <li id=row_1>Record
I have generated class diagram by gight clicking and selecting generate class diagram usign
I have a generated txt file. This file has certain lines that are superfluous,
I'm trying to assign a class that I have within the jQuery UI accordion
I have a few jQueryUI draggable objects that represent nodes generated on my front
I have the following code to generate Jquery UI tabs: <div id=tabs-loading-message style=display:none>Loading, Please
This is my code taken from http://jqueryui.com/demos/draggable/ <!DOCTYPE html> <html lang=en> <head> <meta charset=utf-8>
I have a page with links of class 'dialog' that generate in JQueryUI dialog
I have generated a collection of images. Some of them are blank as in

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.