<table class="@listitems.tablename"> <thead> <tr> <th id="gradeName">@item.GroupLabel</th> <th id="selectCategory" class="grade_td">Select One</th> <th id="Comments">Comments</th> </tr> </thead> <tbody> <td>text</td> <td><input type="radio" name="@items.ControlId" checked="@listItems.IsChecked" class="UnCheckOthers" id="@items.ControlId" value="@listItems.ControlValue"/> @listItems.ControlValue</td> <td class="Comments">comment</td> </tbody></table>
<br /> This is my table structure. Now i want to clear all the td:eq(2) from the above table when i click, any of the radiobuttons inside the table. I have written jquery code to do this task that works fine, for first row of the table how can i empty all the td inside this table using jquery.<br />
$('.UnCheckOthers').click(function () { var className = $(this).closest('table').find('th:eq(0)').text(); $('.' + className.replace(/\s+/g, '').toLowerCase() + ' td:eq(2)').empty(); });
Can anyone give solution to this problem?
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)