方法 1 :
<form id = "form1" name = "form1" method = "post" action = "../ news/index.asp"> <table cellpadding = "0" cellpacing = "0"> <td> <td> <input name = "keyword" type = "text" id = onChange = "SearchType1 () ؛"> <ortive value = "news" select = "select"> 新闻中心 </orpue> <option value = "case"> 工程案例 </soph> </select> <input type = "pridt" type = document.getElementById ("searchtype"). خيارات [document.getElementById ("searchType"). selectIndex] .value ؛ if (type == "news") {document.getElementById ("form1"). Action = "../ news/index.asp"} آخر إذا (type == "case") {document.getElementById ("form1").方法 2 :
<html> <head> <script language = "javaScript"> check () {if (document.form1.a [0] .checked == true) document.form1.Action = "1.htm" elsedocument.form1.action = "2.htm"} </script> </head> onsubmit = "check () ؛"> 转到页面一 <input type = "radio" name = "a"> 转到页面二 <input type = "radio" name = "a"> <input以上这篇用 JS 动态改变表单 form 里的 Action 值属性的两种方法就是小编分享给大家的全部内容了 , 希望能给大家一个参考 , 也希望大家多多支持武林网。