<a href="javascript:alert('b')" onClick="alert('a')">提交</a>
貌似都执行了  

解决方案 »

  1.   


    <script type="text/javascript">
    function formSubmit(){
    alert('a');
    }
    </script><a href="http://www.baidu.com" onClick="formSubmit()">提交</a>IE6和google浏览器下都会先执行alert('a');然后在打开百度页面。
      

  2.   

    <a href="javascript:document.getElementById('form').submit()" onClick="this.href='http://www.baidu.com'">提交1</a>
    在a标签中先运行onclick然后运行href,在你这种写法里其实与<a href="http://www.baidu.com" onClick="">提交1</a>是一个意思。
    其实你提交了表单就不能再转链接,转了链接就不能提交表单,如果非要解决这问题你必须用新开窗口打开链接,而本窗口用来提交表单才行!
    <a href="javascript:alert('b')" onClick="alert('a')">提交</a>这是例外情况alert()本窗口可无限次执行。<form id="form" name="form" method="POST" action="form.html">
        <a href="javascript:void(0)" onClick="fun()">提交</a>
    </form>
    <script type="text/javascript">
        function fun(){
            window.open("http://www.baidu.com","win");
            document.getElementById('form').submit();        
        }
    </script>
      

  3.   

    <a id="subbtn" href="javascript:void(0)" onmousedown="document.getElementById('wd').value='求职';" onclick="document.getElementById('searchForm').submit();">求职</a>
    鼠标按下 向id=wd添加卷标“求职”
    鼠标松开 执行id=searchForm的内容提交