<!doctype html> <html lang="en"> <head> <meta charset="gb2312" /> <meta name="Author" content="Etc"> <title>button test by Etc</title> </head> <script type="text/javascript" > function go(){ window.location.href = 'http://www.google.com'; } </script> <body > form内:<br /> <form name="form1" method="post" action="aaa.aspx" id="form1"> <button οnclick="go();">test1</button> </form> form外<br /> <button οnclick="go();">test1</button> </body> </html>
-----
PS:之前运行代码有点问题,现在已经修正。修正时间2010-06-28。