var toKnowClick;   <input type="submit" name="s1" onclick="javascript:toKnowClick=1;">
   <input type="submit" name="s2" onclick="javascript:toKnowClick=2;">

解决方案 »

  1.   

    <form name="form1" onsubmit="checkSubmit();">
       <input type="submit" name="s1">
       <input type="submit" name="s2">
    </form>
    <script>
    function checkSubmit()
    {
       alert(document.activeElement.name);//code here;
    }
    </script>
      

  2.   

    event.srcElement 不行就用 document.activeElement 嘛
      

  3.   

    <script>
    function checkSubmit()
    {
       var e=document.elementFromPoint(event.clientX,event.clientY);
       if(e!=null&&e!=undefined)
       {
         alert('您点击了'+e.name);
       }
    }
    </script>
    <form name="form1" onsubmit="checkSubmit();">
       <input type="submit" name="s1">
       <input type="submit" name="s2">
    </form>