当前位置:首页 > Web开发 > 正文

js比对两个table的tbody的数据,一个字段是否有不异的,或其他

2024-03-31 Web开发

<html> <header> </header> <body> <!-- 装备清单 --> <div id="zbqd"> <table border="1" cellspacing="0" style=" border-collapse: collapse;font-size: 14px;"> <thead> <tr> <th colspan="3" height="40px;" style="width: 295px;">装备清单</th> <th colspan="1" align="center" style="width: 70px;"> <input type="button" id="ok" class="optInput" value="调拨" onclick="pushEq()" /> </th> </tr> </thead> <tbody id="qdtbody"> <tr> <th align=‘center‘ style=‘width: 120px;‘>装备名称</th> <th align=‘center‘>数量</th> <th align=‘center‘ style=‘width:47px‘>调拨数</th> <th align=‘center‘ style=‘width: 156px;‘>存放地址</th> </tr> <tr id="1"> <td align=‘center‘>信号枪</td> <td align=‘center‘>25</td> <td align=‘center‘><input type=‘text‘ style=‘width: 40px;height: 30px;‘ id=‘qd1‘ value=‘0‘ /></td> <td align=‘center‘>西湖路</td> </tr> <tr id="2"> <td align=‘center‘>装备包</td> <td align=‘center‘>30</td> <td align=‘center‘><input type=‘text‘ style=‘width: 40px;height: 30px;‘ id=‘qd2‘ value=‘0‘ /></td> <td align=‘center‘>起义路</td> </tr> <tr id="3"> <td align=‘center‘>探测器</td> <td align=‘center‘>12</td> <td align=‘center‘><input type=‘text‘ style=‘width: 40px;height: 30px;‘ id=‘qd3‘ value=‘0‘ /></td> <td align=‘center‘>起义路</td> </tr> </tbody> </table> </div> <br> <div id="zdzb"> <table border="1" cellspacing="0" style=" border-collapse: collapse;width: 300px;"> <thead> <tr> <th colspan="4" height="40px;">战斗单元配置标准</th> </tr> </thead> <tbody id="zdzbtbody"> <tr> <th align=‘center‘ style=‘width: 120px;‘>装备名称</th> <th align=‘center‘ style=‘width:47px‘>数量</th> </tr> <tr> <td align=‘center‘>信号枪</td> <td align=‘center‘>10</td> </tr> <tr> <td align=‘center‘>装备包</td> <td align=‘center‘>50</td> </tr> </tbody> </table> </div> <br> <input type="button" id="ok" class="optInput" value="确认" onclick="pushEq()" /> <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script> <script src="demo.js"></script> </body> </html>

demo.js

温馨提示: 本文由Jm博客推荐,转载请保留链接: https://www.jmwww.net/file/web/29293.html