方法1:
<表單id =“ form1” name =“ form1”方法=“ onChange =“ searchtype1();”> <option value =“ select” selection =“ selected”>新聞中心</option> <option> <option valit type = document.getElementById(“ searchType”)。選項[document.getElementById(“ searchType”)。selectionIndex] .value; if(type ==“ news”){document.getElementById(“ form1”)。action =“ ../ news/index.asp”} else if(type ==“ case”){document.getElementById(“ form1”)方法2:
<html> <head> <script Lakenanage =“ JavaScript”>函數check(){if(document.form1.a [0] .a [0] .checked == true)document.form1.form1.action =“ 1.htm” elsedocument.form1.action.actor.action =“ 2.htm” 2.htm“} onSubmit =“ check();”>轉到頁面一<input type =“無線電” name =“ a”>轉到頁面二<input type =“無線電”名稱=“以上這篇用js動態改變表單形式裡的動作值屬性的兩種方法就是小編分享給大家的全部內容了,希望能給大家一個參考,也希望大家多多支持武林網。 ,也希望大家多多支持武林網。