方法 1:
<form id = "form1" name = "form1" method = "post" action = "../ news/index.asp"> <table cellpadding = "0" cellspacing = "0"> <tr> <td> <input name = "คำหลัก" type = "text" id = "คำหลัก"/> </td> onChange = "searchType1 ();"> <ตัวเลือกค่า = "ข่าว" เลือก = "เลือก"> 新闻中心 </ตัวเลือก> <ตัวเลือกค่า = "กรณี"> 工程案例 </ตัวเลือก> </เลือก> <อินพุตประเภท = "ส่ง" name = "subment" value = "搜索"/> </td> type = document.getElementById ("SearchType"). ตัวเลือก [document.getElementById ("SearchType"). SelectedIndex] .Value; if (type == "news") {document.getElementById ("form1"). action = "../ news/index.asp"} อื่นถ้า (type == "case") {document.getElementById ("form1"). action = "../case/index.asp"}}方法 2:
<html> <head> <script language = "JavaScript"> ฟังก์ชั่นตรวจสอบ () {ถ้า (document.form1.a [0] .Checked == true) document.form1.action = "1.htm" elsedocument.form1.action = "2.htm"} </script> </head> onsubMit = "ตรวจสอบ ();"> 转到页面一 <อินพุตประเภท = "วิทยุ" ชื่อ = "a"> 转到页面二 <อินพุต type = "วิทยุ" ชื่อ = "a"> <อินพุตชื่อ = "" type = "subment" value = "提交"> </form> </body> </html>以上这篇用 js 动态改变表单แบบฟอร์ม里的การกระทำ值属性的两种方法就是小编分享给大家的全部内容了, 希望能给大家一个参考, 也希望大家多多支持武林网。也希望大家多多支持武林网。