源代码
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>编程字典</title> </head> <body> <form action="demo_form.php" method="get"> First name: <input type="text" name="fname"><br> Last name: <input type="text" name="lname"><br> <button type="submit">提交</button><br> <button type="submit" formaction="demo_admin.php">作为管理员提交</button> </form> <p><strong>注意:</strong> IE9 和更早的版本不支持 button 的 formaction 属性</p> </body> </html>
运行结果