如何在jQuery中检索表单ID和名称? 最佳答案 如果只有一种形式,则可以执行以下操作:var id = $("form").attr("id"); var text = $("form").attr("name");