OK - this shouldn't be so difficult (sigh)
Hello:
I'm working with a jQuery constructed table. The table assembles wonderfully. Now I want to grab the text() of the 2nd <td> on the row I've selected. But I can't figure out how to do it. Following are the details:
construction syntax:
- function rowBuilder(data) {
- return '<tr class="myRows">'
- + '<td class="e_lay"><input type="checkbox" class="Grp_Chk" value=' + data.GroupID + '></td>'
- + '<td class="b_lay GrpName">'
- + data.GroupName
- + '</td>'
- + '<td class="c_lay">'
- + data.Grp_CreateDate
- + '</td>'
- + '</tr>';
- }
When the first <td class="Grp_Chk"> is checked I want to grab the text() of the 2nd <td class="b_lay GrpName">. The syntax I am using follows:
- var GroupName = '';
- $('#GroupList').on('click', '.Grp_Chk', function() {
- var grpCheck = $(this).is(':checked');
- groupID = $(this).val();
- GroupName = $(this).find(".GrpName").text();
- console.log("group Name: " + GroupName);
- });
Nothing is returned for a value. I've tried $(this).closest and $(this).next all to no avail.
How do I get the text() for the second <td> in the row I select with the checkbox???
Thanks in advance - Pavilion