ITMISS
12345678910111213<form id="Form1"> <button type="button" class="submit">Btn1</button></form><form id="Form2"> <button type="button" class="submit">Btn2</button></form><script> // $(selecter).colsest(parent); // 该方法会从选取元素,向上逐级查找其父节点。并返回第一个查找到的节点 $(".submit").on('click',function () { console.log($(this).closest("form").attr("id")); })</script>