[jQuery] nth-child(n) not working for me - I didn't see my previous post
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: nth child //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"); }); }); Number Letter More 1 A A 2 A B 3 B 3 4 B D
[jQuery] nth-child(n) not working for me.
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: nth child //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"); }); }); Number Letter More 1 A A 2 A B 3 B 3 4 B D