javascript - prompt box can't popup again after it disappeared -
javascript - prompt box can't popup again after it disappeared -
i want popup prompt box when user click trash button. whatever clicked in prompt box, can't popup 1 time again after box disappeared.
html:
<div class="prompt" id="del_product" style="display:none;"> <p>do confirm delete product?</p> <a class="promptbtn" id="cancel_del">cancel</a> <a class="promptbtn" id="confirm_del">ok</a> </div>
jquery:
$(".delbtn").click(function(){ $('#del_product').show() }); $('#cancel_del').click(function(){ $(this).parent().hide() }); $('#confirm_del').click(function(){ $(this).parent().hide() //....will });
how prepare it? thanks
note generally, improve practice not hide .parent()
, .closest('.prompt')
or closest '#del_product' ... prevents issues, additional tags might included either or browser. or cms.
javascript jquery
Comments
Post a Comment