I am facing a difficulty in passing variable for a cell value to get the content in the table cell. Passing the row variable will detect but not the col variable.
var col = $(this).parent().children().index($(this));
var row = $(this).parent().parent().children().index($(this).parent());
//displaying row and col variables do work.
//This is the result I am getting <button style="display:block; width: 100%;">Actual Cell Value</button>
var cellValue;
cellValue = document.getElementById("dataTable").rows[row].cells[col].innerHTML;
alert(cellValue);
//This one returns correct cell value
alert(document.getElementById("dataTable").rows[row].cells[0].innerHTML);