cucuru cucuru - 1 year ago 73
HTML Question

access to a table tr with index

I want to get a row content in my table:

<div class="myTable">
<table id="dataTable">

To get the td I use:


wich works and get the tr data, but, when do it with variable:

var j= 1;

it fails.

What is the problem?

Answer Source
var j= 1;
 $('#dataTable').find('tbody').find('tr:nth-child(' + j +')');
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download