<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"); } }) })
原文地址:https://www.cnblogs.com/ding2011/p/8462903.html
时间: 2024-10-05 00:23:48