答案 0 :(得分:16)
答案 1 :(得分:5)
您可以尝试这样的事情
$(function() {
var buttonpressed;
$('input[type=submit]').click(function() {
buttonpressed = $(this).attr('name')
})
$('form').submit(function() {
alert('button clicked was ' + buttonpressed)
buttonpressed=''
return(false)
})
})
来源:https://forum.jquery.com/topic/determining-which-of-two-submit-buttons-were-clicked-in-a-single-form
答案 2 :(得分:2)
答案 3 :(得分:1)
答案 4 :(得分:0)