Javascript confirm dialog

后端 未结 5 860
野性不改
野性不改 2021-02-05 15:59

I want to add a confirm dialog to a delete button to ask the user whether it is ok or not deleting the selected item.

If not, nothing should happend, else a url should be

5条回答
  •  闹比i
    闹比i (楼主)
    2021-02-05 16:50

    You can return the confirm() (which returns true/false), like this:

    Delete
    

    You can test it here

提交回复
热议问题