="id" id="editId" value=""> <label>domain</label> <input type="text" name="domain" id="editDomain" required maxlength="200" placeholder="如 asd.com"> </div> <label>title</label> <input type="text" name="title" id="editTitle" required maxlength="200" placeholder="标题"> </div> <button type="submit" class="btn">保存</button> <button type="button" class="btn" id="btnCancel" style="display:none">取消</button> </form> </div> </div> <table> <thead> <tr> <th>id</th> <th>domain</th> <th>title</th> <th>操作</th> </tr> </thead> <tbody id="list"></tbody> </table> <script> const API = 'api.php'; const listEl = document.getElementById('list'); const form = document.getElementById('editForm'); const formTitle = document.getElementById('formTitle'); const editId = document.getElementById('editId'); const editDomain = document.getElementById('editDomain'); const editTitle = document.getElementById('editTitle'); const btnCancel = document.getElementById('btnCancel'); const msgEl = document.getElementBy