<form method="post" id="form"> <input type="submit" value="发布"/> <input type="submit" value="存为草稿" /> <input type="submit" value="取消" /> </form>
$(function () { $("input[type=‘submit‘]").click(function () { var text = $(this).val(); if (text == "发布") { $("#form").attr("action", "/Home/pub"); } else if (text == "存为草稿") { $("#form").attr("action", "/Home/caogao"); } else { //取消 $("#form").attr("action", "/Home/cancel"); } }) })