I have code that creates a table, each cell of which contains a with an id of row number + "," + column_number (e.g. the top-left cell is built with:
<td><div id="0,0">This is 0,0</div></td>
). I want to be able to modify a cell's contents within the code without having to refresh the entire page, but I can't figure out how to update a particular by ID dynamically. When I do something like this:
var row = 1;
var col = 1;
var newCellContents = "This cell is changed";
var divID = row.toString() + "," + col.toString();
$(divID).html(newCellContents);
it throws a syntax error; I assume it is trying to find a div named "divID".
How would I get it to update the div with ID "1,1"?