复制代码代码如下: function getid(id) { alert(id); } <input id="btn1" type="button" value="test" onclick="return getid(this.id)" />