
js判断点击按钮
<inputtype="button"id="aa"/><inputtype="button"id="bb"/>不想在按钮上加onclick事件,怎么样用js实现自动识别...
<input type="button" id="aa" />
<input type="button" id="bb" />
不想在按钮上加onclick事件,怎么样用js实现自动识别呢? 展开
<input type="button" id="bb" />
不想在按钮上加onclick事件,怎么样用js实现自动识别呢? 展开
1个回答
展开全部
document.getElementById('aa').onclick = function(){
alert(1);
}
alert(1);
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询