参考网址:https://zhidao.baidu.com/question/499093977.html
function c(self){
alert(self.id);
}
<input type='button' id='id1' onclick='c(this)'/> 这里传入this,代表当前input
<input type='button' id='id2' onclick='c(this)'/> 这里传入this,代表当前input
参考网址:https://zhidao.baidu.com/question/499093977.html
function c(self){
alert(self.id);
}
<input type='button' id='id1' onclick='c(this)'/> 这里传入this,代表当前input
<input type='button' id='id2' onclick='c(this)'/> 这里传入this,代表当前input