Pass index into nth-child() Please Help!!
Afternoon All,
I have the following that works fine, I'm trying to extend the functionality so that when a user clicks a button the formula will look up the values of the next column. These are then passed into the google charts api. So affectively they will see a new graph based on the next columns values.
This is working fine
$('#WebPartWPQ11 .ms-vb2:nth-child(2)').each(function(i){
var points = $(this).text();
coord[i] = points;
});
So I thought if i declare a variable with the same default value, and pass that into the nth-child function it should return the values in the column. Once up and running by clicking the next button, the column would be incremented by 1, thus the formula would return the values in the next column
var column = 2;
$('#WebPartWPQ11 .ms-vb2:nth-child("+column+")').each(function(i){
var points = $(this).text();
coord[i] = points;
});
However im having no luck with the ("+column+")
I've tried just (column) and changing the quotes
I'm sure this is a simple mistake.
Thanks for your help
Regards
Gary