一个form多个submit,提交不同的地址

来源:互联网 发布:linux shell wait 编辑:程序博客网 时间:2024/05/19 11:44
<html> <body><form name="form1"> <input type= "submit" value= "百度" onClick= "baidu()"> <input type= "submit" value= "新浪" onClick= "sina()"> </form> </body></html> <script language= "JavaScript"> function baidu(){ document.form1.method= "get";     document.form1.action= "http://baidu.com "; document.form1.submit();console.log(document.form1.action)return   true; } function sina(){ document.form1.method= "get"; document.form1.action= "http://sina.com "; document.form1.submit(); return   true; } </script> 


转载:http://yiranwuqing.iteye.com/blog/707753

原创粉丝点击