Skip to content

Instantly share code, notes, and snippets.

View RCopeland's full-sized avatar
😎

Rob Copeland RCopeland

😎
View GitHub Profile

Creating an 'Are You Sure?' Modal

If you have a user using your site, and let's say its a secure site with a login, and that user wants to follow a link that you've provided, you'll need to make sure that they meant it, as navigating away will likely log the user out. You could open the link in a new tab by default, but then you're overriding the browser default behavior, which we know is rarely a good idea.

A Pen by Rob Copeland on CodePen.

License.