我需要在用戶輸入他們的姓名首字母后自動添加時間戳,然后將創(chuàng)建新行,并且我需要將下一行的 tote# 增加到下一個數(shù)字,例如。(第 2 行 tote# 將是 2 )這是我的表結構<table id="harvestedCannabis"> <tr> <th>Tote #</th> <th>Flowers</th> <th>Trim A</th> <th>Trim B</th> <th>Waste</th> <th>Originating Line(A,B,C)</th> <th>Preformed By</th> <th>Time Stamp</th> </tr> <tr> <td>1</td> <td><input type="number" step=".1"></td> <td><input type="number" step=".1"></td> <td><input type="number" step=".1"></td> <td><input type="number" step=".1"></td> <td><input type="text"></td> <td><input type="text" id="preformedBy"></td> <td id="timeStamp"></td> </tr> </table>這是我的 JS$(document).ready(function(){ $("#preformedBy").change(function(){ $('#harvestedCannabis > tbody:last-child').append('<tr><td>1</td><td><input type="number" step=".1"></td><td><input type="number" step=".1"></td><td><input type="number" step=".1"></td><td><input type="number" step=".1"></td><td><input type="text"></td><td><input type="text" id="preformedBy"></td><td id="timeStamp"></td></tr>'); }); });我希望在用戶輸入他們的 initails 時自動輸入時間戳并增加 tote#
如何自動向表行添加時間戳并在更改時增加手提包#
慕桂英546537
2021-09-17 10:16:07