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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T03:12:12+00:00 2026-05-22T03:12:12+00:00

I am fairly new to jquery and I have a question about updating data

  • 0

I am fairly new to jquery and I have a question about updating data within my page.

I have an Unordered List that I allow the user to manipulate. While the UL starts with only one list item, I allow the user to add objects to this array. I have a goal now to have the user click the object from the UL, which pulls that into a read only textarea, and another textarea to allow for the user to input a custom string and have the targeted list item’s (text()) become the custom string.

Now, I’m not confused as to how to pull the .text(), and I am pretty sure I can put the custom string the user creates INTO the chosen list item’s text attribute…

The problem I’m having is for example:

The page starts out with one single (blank) object in the array. I click “add object” and now the original array is changed to hold 2 objects or 3, etc. The objects that were added to this array are not “appearing” to my JQuery script. Only this first object will transfer its text to the textarea when clicked. Same goes for if I Initialize this array with, say 3 objects… only those three will be active.

I can show snippets of code if that will help. Or if you have questions, please ask and we’ll go from there, thanks.

My testing URL: http://whoneedsstandards.com/subdomains/travis/jquery.htm … maybe you can follow my step-by-step?

Code:

//add to list items//
    $('a#add').click(function () {
        $('<li id="' + i + '">Blank Object</li>' + i + '').appendTo('#ul1');
        i++;
        $('#ul1>li:even').addClass('alert');
        $('#ul1').load();
    });
//click list item to store in textarea//
    $('#ul1>li').click(function () {
        var temptext = ($(this).text());
        $('textarea#text1').text(temptext);

    });
  • 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-22T03:12:13+00:00Added an answer on May 22, 2026 at 3:12 am

    Use the .live method to register your click handler.

    var lastClickedLi;
    
    $("#ul1 > li").live("click", function() {
        lastClickedLi = $(this);
    });
    

    See the fiddle for a more complete example.

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

Sidebar

Related Questions

I am fairly new to jQuery and I have this overlay window that pops
I fairly new to JQuery and perhaps trying to achieve something that might be
I am fairly new to JQuery. That being said I am trying to use
I'm fairly new to jQuery and I'm having trouble with an animation that I'd
I am fairly new to JQuery API. I have been using mouseover, but I
I'm fairly new to jquery and struggling with something that should be fairly simple.
I'm fairly new to jquery and so far i have got my code to
This is probably a fairly easy question, but I'm new to JavaScript and jquery....
I am fairly new to jQuery and I wanted to ask a question. Basically
I am fairly new to jQuery and JavaScript in general. I have a form,

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.