[英]Alertify for OnClick Event of Button
我正在嘗試顯示一條消息,用戶單擊時單擊了“刪除”按鈕。 這就是我在做什么:
<script>
$('#button_del').on('click',function(e){
alertify.error('You have clicked on Delete!');
});
</script>
但是,當我單擊按鈕時,沒有消息出現。 我究竟做錯了什么?
這里只有四種可能性:
button_del
ID的元素,或者涉及它的標記錯誤。 #button_del
沒有單擊#button_del
。 4.最有可能的一個 :
加載文檔時,您需要附加單擊處理程序,否則#button_del
可能尚不可用/已加載!
$(document).ready(function() {
$('#button_del').on('click',function(e){
alertify.error('You have clicked on Delete!');
});
});
即使滿足前三個條件,您仍然必須更改此設置。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.