I’m working on a web platform that use a lot of tables to render on browser.
So I need to use the index() of some elements to provide an interaction to the users.
But as I commented above when I try those tables, the index isn’t working very well.
Details here: http://jsfiddle.net/gambin/JGWe3/3/
I tried to use another ways (without tables) and it’s working without any problem!
Any suggestions?
You get the index with respect to its immediate parent, here your immediate parent is td and which is preceded by span so you get index 1, To get the index of each element with respect to parent table you need index of row enclosing subBullet class. You can get row index by following code, 0 index for first row and so on. Reading this on jquery Doc worth understanding how index() works.
Live Demo using table
Live Demo using Div