Here is the code, it refers to TD, and "farmland" is the table identifier:
$("#farmland td").click(function(){ $("#console").html($(this).index() + 1 + ", " + $(this).parent().index() + 1); });
When I press TD, I get 1.01 or 1.11 or 1.21, etc ... the number is correctly added for .index (), but for .parent (). index () is added 1 as if it were a string!
I thought that it was very curious, because I expected that it would either act in one way, or in another, and not in two different ways!
My first guess may be that it is because my + ", " +
switches it to work as a string?
source share