I have the following jQuery:
$.fn.dataTableExt.afnSortData['dom-text'] = function (oSettings, iColumn) {
var aData = [];
$('td:eq(' + iColumn + ') input', oSettings.oApi._fnGetTrNodes(oSettings)).each(function () {
aData.push(this.value);
});
return aData;
}
I’m using this to get the value of the input in td elements.
However my HTML now looks like this:
<td id="tempRowKey_117" class=" sorting_1" data-rk="100001">
<input type="text" value="10.0.1" id="TempRowKey_117">
</td>
How can I change my jQuery so that it now gets the value of data-rk instead of the value of the input?
In other words I want to get “10001”
1 Answer