<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>