joikuspot:js判断table是否为空 2024-04-17 07:18:22 0 0 判断如下的FileTable合适含有TR,何时不含有TR。即是否为空? <table id="FileTable" border="0" style="border-width:0px;width:800px;"> </table> <table id="FileTable" border="0" style="border-width:0px;width:800px;"> <tr style="height:24px;"> <td align="left" style="width:90%;"> <a href='#' οnclick="_javascript:ViewFile(2001,'BQC.EMP.1111117077')">4.bmp</a></td><td style="width:600px;white-space:nowrap;"> </td> </tr> </table> JS代码如下: <script type="text/javascript"> var tableObj = document.getElementById('FileTable').rows[0]; if (tableObj == null) { alert('请上传检测报告!'); return false; } </script> 收藏(0)