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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T17:08:45+00:00 2026-05-30T17:08:45+00:00

i am using java-script function when i click a td the value is stored

  • 0

i am using java-script function when i click a td the value is stored in a variable and display in a textarea its works good. but when i click another td value in the textarea changed to new one.

I am using java script for creating table and with javascript itself i generate the id

 str += "<td id='R" + i + "C" + j"'>Demo</td>";

Here my code execute when click is triggered

      $(this).addClass('active');
      var id = $(this).closest('td').attr('id');
      document.getElementById('hit').value += id; //hit- id of textarea

is it any way for append the values one by one when user clicks multiple td

  • 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-30T17:08:47+00:00Added an answer on May 30, 2026 at 5:08 pm

    i don’t know if i grasped your question clearly but if you want to append to the textarea the value of the td clicked instead of replacing it you can do something like this:

     $("td").click(function(){
        $(this).addClass('active');  //i let this but i don't get what you need it for
        $('#hit').val($('#hit').val()+$(this).text());
    });
    

    if you want to store the value of the td you can just put an additional :
    var value = $(this).text();

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

Sidebar

Related Questions

This is the file I'm using $.load() to load into DOM: <script type=text/javascript> $('.close').click(function()
I'm using a javascript function to submit my form. This works in every browser
is there any example on using java method to call rhino-javascript function and return
I have a variable that I'm using to build a JavaScript function call, and
i have to pass a string value which is stored in a variable to
I am trying to get the dimensions of my browser window using java script.
i'm using javascript with symfony 1.4 $(#annonc).change( function() { var _annonce = this.options[this.selectedIndex].value; ...........
I am using JavaScript, jQuery and PHP. How do I limit the JavaScript function
Using the javascript function function squareIt(number) { return number * number; } When given
How do you trigger a javascript function using actionscript in flash? The goal is

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.