I tried the following code to understand how i can get 0 if the value is not defined.
This below is my try to understand but I am getting same error as described below.
var tbl = $("#tableOccupation")[0] != 'undefined' ? $("#tableOccupation")[0] : 0;
alert(tbl.rows.length);
that if not undefined,
return 0
else return whatever the rows.length
is
that is above my try but it is still showing
Uncaught TypeError: tbl is undefined