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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T03:54:06+00:00 2026-05-15T03:54:06+00:00

So I have a series of 2 nested ul’s. When you click on the

  • 0

So I have a series of 2 nested ul’s. When you click on the text (which is in an a tag) in the li, my page makes that editable and adds a save button. clicking the save button needs to give me back the new text inside that li and the id of that li. The id is not a problem. I’m trying to use jQuery’s .find to select that anchor tag (which is successful) but i can’t seem to get the text from it.

Here is an example of the first list and it’s sublists.

<ul class='lists'>
  <li class='list1'>
    <a class='a list' id='list1'> List 1 Name</a>
    <img id='savelist1id' onClick="SaveName(this.parentNode.id)" src='save.jpg'>
    <ul class='sublists'>
      <li class='sub1'>
        <a class='a sub' id='sub1id'> Sub 1 Name</a>
        <img id='savesub1id' onClick="SaveName(this.parentNode.id)" src='save.jpg'>
      </li>
      <li class='sub3'>
        <a class='a sub' id='sub2id'> Sub 2 Name</a>
        <img id='savesub2id' onClick="SaveName(this.parentNode.id)" src='save.jpg'>
      </li>
      <li class='sub2'>
        <a class='a sub' id='sub3id'> Sub 3 Name</a>
        <img id='savesub3id' onClick="SaveName(this.parentNode.id)" src='save.jpg'>
      </li>
    </ul>
  </li>
</ul>

Here’s the code for identifying which save button you clicked.

function SaveName(parentid){
  $('li').find('a').each(function(){
    if (this.id == parentid){
      alert(this.id+' '+this.text)
      }
  }
});

I am wanting this.text to show me the text inside the anchor tags. Help, please?

===========================================================
Edit:

Please excuse this post. The problem was that I was using Jeditable and didn’t know that it would put in a form in place of the text, so anything that would call text wouldn’t work. Sorry.

  • 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-15T03:54:07+00:00Added an answer on May 15, 2026 at 3:54 am

    Ok, so when I clicked on the field, I was using Jeditable to make the field edit in place. Clearly I didn’t understand what this doing, because it inserts a form using what you supply. This is why whatever.text() was coming back blank. It wasn’t counting the form as text, so it skipped it.

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

Sidebar

Related Questions

I have a series of DIVs on a page which each contain a nested
I have a series of nested UL's that are like this: <ul class=categorySelect id=>
I have a series of nested TableLayoutPanel controls which each of them contains lots
I have a series of div elements on my page which look like the
I would like to be able to have a series of nested loops that
I have a series of PHP page, and I would like to use conditional
I have a series of logging breakpoints in Xcode4 that I'm using to selectively
I have a series of divs that slide down using -webkit-transform from a negative
I have a series of images that get loaded for a carousel, and it
I have a series of grouped values that follow a specific format and would

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.