如果<td>标签为空(无文本)...运行php列表页面的jquery脚本

I have a php page that generates a list of stock items and I want to determine if the table td for the stock items are empty so that I can run a jquery script that states that we either have the stock item or not.

jQuery(document).ready(function() {
    if ($("#paperId:empty")) {
        $('#tablebox').append("<h2 class=\"floatclear\">There is stock that matches your search parameters.</h2>");
    } else {
        $("table").hide();
        $('#papernav').hide();
        $('#tablebox').append("<h2 class=\"floatclear\">No Stock is currently available.</h2>");
    }
})

I think that I should be running this with every submit but don't know how?

there's no $("#paperId") in first place.

When you generate the table, in each record add a class like 'papperID' and then count the length of the elements in the dom.

  $(".paperId").length