我有按钮,我试图通过 jquery 检测按钮是否附加了单击事件并且有特定消息,请隐藏它。
到目前为止,我没有任何结果:
这是我的代码:
<button name="submit" type="submit" class="iuttons" onclick="alert('The number of pages in your results is too long for us to print.');"><img height="16" alt="Submit" src="mall.png" width="16" align="center"></button>
我正在尝试这样的事情:但不确定如何:
$("#iuttons").on('submit').length() {
hide the button [same button]
}else{
show the button
}
这需要在准备好的文档上运行,以便它知道要做什么
最佳答案
我不确定你到底想做什么,但如果你想隐藏点击按钮,请使用这个:
$('.iuttons').click(function() {
$(this).hide();
});
关于javascript - 检测按钮 onclick 事件是否附加,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27804898/