1 <form name="myform" id="myform" action="ssss" method="post" onsubmit="getUrl();">
1 function test1(){
2 alert(document.myform.action);//返回值:http://localhost:8080/XXX/ssss
3 alert(document.myform.attributes["action"].value);//返回值:ssss 与上一行有区别
4 // 以下三行,随便哪一行都行
5 document.getElementById('myform').action=‘new_url’;
6 document.myform.action=‘new_url’;
7 document.myform.attributes["action"].value = 'new_url';
8 }