I have a JavaScript function for a button. When the button is clicked, it will display information. I'm trying to check if there are no results in the current set and go to the next set of results.
$("#mybutton").on("click", function() {
var $rowsNo = $("#table tbody tr").hide().filter(function () {
var $checkresults = $.trim($(this).find("td").eq(0).text()) === "1";
if ($checkresults != null){
return $.trim($(this).find("td").eq(0).text()) === "1"
} else
return $.trim($(this).find("td").eq(0).text()) === "2"
}).show();
});
This solution only seems to still be capturing the first option only and displaying null data. is there a better way to handle this type of scenario?