I have got a problem where I need to access the <td> of <tr> using the jquery .eq() function. Below is the code mentioned please have a look.
var foundElement = 3;
var values = $(this).children("td:nth-child('" + foundElement + "')").map(function () {...
The above statement gives error for using “foundElement” as variable between the statement. Please give me a alternate solution or declaration for this.
You do not need the single quotes around the
foundElement.The selector should be:
or in the string with variable replacement as: