how to get selected table row index in javascript