diff --git a/src/tablesort.js b/src/tablesort.js index b52a96b..f128024 100644 --- a/src/tablesort.js +++ b/src/tablesort.js @@ -24,7 +24,10 @@ }; var getInnerText = function(el) { - return el.getAttribute('data-sort') || el.textContent || el.innerText || ''; + if(el.hasAttribute('data-sort')) { + return el.getAttribute('data-sort'); + } + return el.textContent || el.innerText || ''; }; // Default sort method if no better sort method is found