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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:44:21+00:00 2026-06-11T05:44:21+00:00

I am using Jquery to dynamically populate the table element. My table will have

  • 0

I am using Jquery to dynamically populate the table element. My table will have three columns – Label, textarea and a button. I am binding a click event on click of the button. Below is my Jquery code.

var rowElem = $('<tr id="'+ key + '" class="queryRow"> </tr>');
rowElem.append($('<td class="queryTitleCol">' + key + '</td>')); 
var colElem = $('<td class="queryValueCol"></td>');
var textAreaElem = $('<textarea rows="10" cols="75"/>');
colElem.append(textAreaElem);
rowElem.append(colElem);
textAreaElem.val(value);
var btnCol = $(
            '<td valign="top">'
            + '<button style="width:42px; vertical-align:middle; margin:2px;" title="delete">'
            +   '<span class="ui-icon ui-icon-trash" style="float:left;"/>'
            + '</button>'
            +'</td>');
    rowElem.append(btnCol);
    $("button", btnCol).click(action);
}

In the button event I am using Jqury.closest to get the TR tag and label element. Below is my code for button click.

function action() { 
var rowElem = $(this).closest("tr");
var labelTD = $(".queryTitleCol", rowElem);
}

But labelTD , I am always getting as [td.queryTitleCol] as an array. I am not able to get the td element to get the lable element. I tried with find(), but still I am getting as td array.

rowElem.find('td.queryTitleCol');

How can I traverse and get the label name on click function of the button. Any help will be really appreciated.

  • 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-06-11T05:44:23+00:00Added an answer on June 11, 2026 at 5:44 am

    Try

    var label = $(".queryTitleCol", rowElem)[0].innerHTML;
    

    or

    var label = $(".queryTitleCol", rowElem).text();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using jQuery 1.7 I'm having trouble binding a Click event to some dynamically loaded
I have a jquery scorlling table which is populated dynamically. I am using Bob
I have a form where I dynamically populate a DropDownList using Jquery's ajax function
I'm using a custom jScrollPane and dynamically populate it using jQuery from a returned
I am using HTML5,Jquery(v1.6.4) and Jquery-mobile(jquery.mobile-1.0.1.js). I want to populate data dynamically using Jquery.
I have a page that dynamically creates (using jQuery) Input boxes for the user.
So I have a system using jQuery AJAX to load the content dynamically. I
I'm using Ajax to dynamically populate a DIV. I have each page content stored
I'm using jQuery to dynamically populate some cascading drop-down controls when a page loads.
I'm using jquery Populate to dynamically populate a field with the previous Firstname and

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.