Write this in onclick event of the button:

var result = confirm("Want to delete?");
if (result) {
    //Logic to delete the item
}
Answer from Ved on Stack Overflow
🌐
Reddit
reddit.com › r/uxdesign › deletion confirmation
r/UXDesign on Reddit: Deletion confirmation
July 17, 2024 -

Hey peeps.

I was having a chat with a colleague about deleting items and bulk clearing fields in a form. He asked what about how should we confirm the deletion. (Not how we confirm the intention - we have a pattern for that and it is a pretty common confirmation popup dialog) How does the system confirm to the user that the action has gone thru.

I was arguing that the fact that the content from the fields or the file in question being no longer present is enough of a confirmation of that distructive action taking place. He was proposing a green success toast message with a "Deletetion successful" type message - and the team agrees that this (out of 3 types of visual confirmations) is the way.

Is it something that I am missing here? Because I still feel that less is more in this case. Why bother with an extra message?

Discussions

microcopy - What are some alternatives to the phrase "Are you sure you want to XYZ" in confirmation dialogs? - User Experience Stack Exchange
The Apple Human Interface Guidelines ... about message boxes (alert panels). Button names should correspond to the action the user performs when pressing the button—for example, Erase, Save, or Delete. The rightmost button in the dialog, the action button, is the button that confirms the alert ... More on ux.stackexchange.com
🌐 ux.stackexchange.com
August 23, 2010
How to suppress or modify Delete confirmation message
How do I suppress or modify the Delete confirmation message when the dustbin/trashcan button is clicked (see example below) · In this case it's my custom page and table. I am handling the OnDeleteRecordEvent. This is working fine except I now get two confirmation dialogs. More on community.dynamics.com
🌐 community.dynamics.com
iMessage delete confirmation - Apple Community
Has apple provided a way to turn off the delete confirmation popup, or is this another one of the ways Cupertino infantilizes its customers by not allowing them to choose? ... No, there isn't. The confirmation message is something people have asked for due to accidental deletions. More on discussions.apple.com
🌐 discussions.apple.com
How to handle delete confirmation from within a modal?
Welcome to UI Design. This sub's goal is to create a place for discussion surrounding UI Design. There is no self-promotion allowed in this sub. This includes posting URLs of any kind that is intended for self-promotion purposes. Constructive design criticism is encouraged, and hate and personal attacks are not tolerated. Remember, downvoting is not critiquing. I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns. More on reddit.com
🌐 r/UI_Design
8
10
August 14, 2021
🌐
OutSystems
outsystems.com › forums › discussion › 65310 › delete-confirmation-popup
Delete confirmation popup | OutSystems
Could you please help me with a sample implementation to refer, on how to implement a confirmation pop up message for a delete button action in Traditional Web page: · In the Button Widget there exist a property called Confirmation Message, which is used for the same purpose which you have ...
🌐
W3Schools
w3schools.com › howto › howto_css_delete_modal.asp
How To Create a Delete Confirmation Modal
Create a Website Make a Website Make a Static Website Host a Static Website Make a Website (W3.CSS) Make a Website (BS3) Make a Website (BS4) Make a Website (BS5) Create and View a Website Create a Link Tree Website Create a Portfolio Create a Resume Make a Restaurant Website Make a Business Website Make a WebBook Center Website Contact Section About Page Big Header Example Website · 2 Column Layout 3 Column Layout 4 Column Layout Expanding Grid List Grid View Mixed Column Layout Column Cards Zig Zag Layout Blog Layout · Google Charts Google Fonts Google Font Pairings Google Set up Analytics · Convert Weight Convert Temperature Convert Length Convert Speed · Get a Developer Job Become a Front-End Dev. Hire Developers ... Learn how to create a delete confirmation modal with CSS.
🌐
Talkerscode
talkerscode.com › webtricks › simple-and-best-delete-confirmation-box-message-using-jquery-html-and-css.php
Simple And Best Delete Confirmation Message Using jQuery HTML And CSS
July 1, 2023 - Delete is no recovering process if a user delete something it will not recover.So there must be Confimation message so that if a user mistakenly or intentionally clicks on delete button a confirmation message slides down and ask the user whether he or she want to delete somthing.In this tutorial we will create a Delete Confimation Message using jQuery, HTML and CSS.
Top answer
1 of 10
84

Part of the reason that people skip over long messages is due to reading speed.

Assume for the sake of discussion someone with an average reading speed - around 200 words per minute.(*)

If you use just 20 words in a dialog, you're asking that user to spend 6 seconds reading and understanding what you wrote.

While that doesn't sound like much, a six second imposed pause when you're trying to get something done can seem to be an awfully long time.

(*) And don't make the mistake of assuming that low reading speed means low intelligence.

So, three suggestions for you, all aimed at maximum clarity with minimum fuss.

  1. Be as concise as possible
  2. Identify the item at risk
  3. Name your buttons for the actions

Here is a simple deletion dialog:

Let's reduce the number of words to the minimum to make it easier to read:

Now, let's identify the item at risk, and label the buttons for the action:

Much better - easier to read and clearer.

Another example - a continuation dialog.

Simplify wording.

Again, let's identify what's going on and label the buttons for the actions.

A definite improvement.

Here's a final thought. Avoid negatives, especially double negatives. Some native English speakers find double negatives tricky, and many who learn English as a second language find them confusing (especially if their native tongue uses double-negatives for emphasis instead of inversion).

2 of 10
20

I always make a point of showing the user which item is being deleted (especially since the dialogue might obscure the item in question, but also because seeing identifiable text in the dialogue will call attention):

Delete "your favourite item"?

You can also inject a little humour here and there, depending on what kind of app you're making:

Surely you don't want to continue without saving? [Yes I do, leave me alone] [Oh right, thanks for reminding me]

If you user test it you'll notice that humorous messages get noticed a bit more frequently simply because they sort of stand out from the crowd of generic messages and (if they're actually cute enough) get a smile on the face of the user. What more could you want?

🌐
30 Days Coding
30dayscoding.com › blog › javascript-confirm-delete
JavaScript Confirm Delete: A Comprehensive Guide
April 27, 2024 - ... The syntax for the `confirm()` function is as follows: ```javascript var result = confirm("Are you sure you want to delete this item?"); ``` In this example, the `confirm()` function takes a string argument, which is the message to be displayed in the dialog box.
Find elsewhere
🌐
SmartBear
support.smartbear.com › testcomplete › docs › working-with › managing-projects › messages › remove-or-delete-confirmation.html
Message - Remove or Delete Confirmation | TestComplete Documentation
This message is displayed if you are trying to remove a project, project item, element or virtual folder, and suggests whether you want to remove the item logically (the Remove button), or physically (the Delete button).
🌐
Blazorise
blazorise.com › blocks › applications › crud › delete-confirmations
Blazorise Delete Confirm (CRUD) - Blazorise UI components
In the delete confirmation modal component, use this example to display an alert message that details the implications of deleting a database item.
🌐
CodexWorld
codexworld.com › home › how to guides › how to show delete confirmation message using javascript
How to Show Delete Confirmation Message using JavaScript - CodexWorld
November 5, 2018 - Confirmation dialog using JavaScript - Use Window confirm() method to show confirm delete popup box. Use onclick() event to display a confirmation dialog when clicking anchor link.
🌐
Dribbble
dribbble.com › search › confirm-delete
Browse thousands of Confirm Delete images for design inspiration | Dribbble
Explore thousands of high-quality confirm delete images on Dribbble. Your resource to get inspired, discover and connect with designers worldwide.
🌐
Appcues
goodux.appcues.com › modal windows › tumblr's delete account confirmation modal
Tumblr's delete account confirmation modal - GoodUX
To ensure that the decision is intentional and that the repercussions are fully understood, Tumblr presents a fullscreen modal to users who opt to delete their account. It's a simple but effective bit of UX that's done very well. ... The text here is awesome. It's clever, funny, and on brand. Complex user action is required—users must manually type their information—in order to confirm deletion, rather than merely having another button that says "Yes, I'd really like to delete my account".
🌐
Tutorialdeep
tutorialdeep.com › knowhow › jquery faqs › how to show delete confirmation message in javascript
Delete Confirmation Message to Show Before Delete
April 16, 2024 - To show a delete confirmation message in an alert box, use the confirm() function of Javascript inside the onclick attribute. It can be possible that the use
🌐
Pragimtech
pragimtech.com › blog › blazor › delete-confirmation-dialog-in-blazor
Delete confirmation dialog in Blazor
In our example, Delete confirmation must be displayed when Delete button on Employee card is clicked.
🌐
Dynamics Community
community.dynamics.com › forums › thread › details
How to suppress or modify Delete confirmation message
How do I suppress or modify the Delete confirmation message when the dustbin/trashcan button is clicked (see example below) · In this case it's my custom page and table. I am handling the OnDeleteRecordEvent. This is working fine except I now get two confirmation dialogs.
🌐
Apple Community
discussions.apple.com › thread › 250770675
iMessage delete confirmation - Apple Community
Is there any danger and how can I fix the problem so that I don't get such messages anymore. [Edited by Moderator] 879 1 · iMessage delete and report as junk Hi. I accidentally hit delete report as junk on an important iMessage account! Is there a way to undo this? 1045 2 ... No, there isn't. The confirmation message is something people have asked for due to accidental deletions.
🌐
Cloudscape
cloudscape.design › patterns › resource-management › delete › delete-with-additional-confirmation
Delete with additional confirmation - Cloudscape Design System
For example: If the interface is ... for all modal text, except for any text in a list format. ... For the button that performs the action, use this text: Delete....
🌐
Telerik
telerik.com › knowledge base › customize the delete confirmation dialog
Blazor Customize the Delete Confirmation Dialog - Telerik UI for Blazor
January 27, 2026 - The keys for the elements of the built-in Delete Confirmation Dialog are: The keys for the Treelist and Scheduler components are the same, just change the component name before the _ symbol. Use a Predefined Confirm Dialog with the desired custom text.