Hello!
I am looking for a way to do the following with a normal HTML table using jQuery.
- Extracting the index of the clicked cell and the index of the row it belongs too.
- Highlight the selected cell and remove the highlight when it is clicked again.
- Keep track of which cells that are selected so that I can save them into a database.
This is what I have done so far:
$("#frame td").click(function(e) {
var RowSelected = $(this).parent().parent().children().index($(this).parent());
var CellSelected = e.target.cellIndex;
$(this).toggleClass("selected", this.clicked);
$("#cells").append("R" + RowSelected + "C" + CellSelected + ", ");
});
Please help!