比如<input id="Button1" type="button" value="button" onclick="return Button1_onclick()" />
function Button1_onclick() {}
如何在Button1_onclick() 事件里获取Button1这个值

解决方案 »

  1.   

    function Button1_onclick() {
    alert(event.srcElement.id);
      

  2.   

    这个简单
    <input id="Button1" type="button" value="button" onclick="return Button1_onclick(this.id)" /> 
    function Button1_onclick(id) {alert(id);} 
    给分不?……
      

  3.   

    clientId
    .
    人力资源
      

  4.   

    function getId()
    {
      document.getElementById("botton1");
    }
      

  5.   


    function getId() 

      var butValue=document.getElementById("botton1"); 
      alert(butValue);
    }
      

  6.   

    <input type="button" id="id1" value="click" onclick="show(this)">function show(obj){
      alert(obj.id);
    }