How to stop event propagation with inline onclick attribute?

前端 未结 13 2109
情书的邮戳
情书的邮戳 2020-11-21 23:46

Consider the following:

13条回答
  •  时光说笑
    2020-11-22 00:23

    This also works - In the link HTML use onclick with return like this :

    Delete
    

    And then the comfirmClick() function should be like:

    function confirmClick() {
        if(confirm("Do you really want to delete this task?")) {
            return true;
        } else {
            return false;
        }
    };
    

提交回复
热议问题