You're not really referencing the 'n' variable you just defined, as
you're passing a string.
var n = 2;
$(#filterTable tbody tr td:nth-child(+n+)).each(function(){
On Sep 17, 2:24 pm, kcharles [EMAIL PROTECTED] wrote:
I switch between var n = 2; nth-child(n) and nth-child(2) and get
different behavior.
Any suggestions/work arounds?
Thanks!
Here is the code:
html
head
titlenth child/title
script type=text/javascript src=jquery.js/script
script type=text/javascript
//Add input box for each column
$(function(){
var n = 2;
// $(#filterTable tbody tr td:nth-child(2)).each(function(){
$(#filterTable tbody tr td:nth-child(n)).each(function(){
$(this).append(this row);
});
});
/script
/head
body
table id=filterTable width=580 border=1
thead
tr
thNumber/th
thLetter/th
thMore/th
/tr
/thead
tbody
tr
td1/td
tdA/td
tdA/td
/tr
tr
td2/td
tdA/td
tdB/td
/tr
tr
td3/td
tdB/td
td3/td
/tr
tr
td4/td
tdB/td
tdD/td
/tr
/tbody
/table
/body
/html