Request confirmation on link

Shows how to request for confirmation before navigating a link.

Some hyperlinks may be more sensitive than others. For instance, hyperlinks may be used to issue commands. This example demonstrates the onclick-confirm attribute that propagates the click event only when accepted by the user:

<a href="https://www.google.com/" onclick-confirm="Are you sure you want to leave ?">Go to Google</a>

The onclick-confirm attribute can intercept any click event and can also be used with buttons and other clickable objects.

 

Working demo
Loading demo...

 

Requirements

This example requires following Sircl library files to be loaded:

or:

Or their non-minified counterparts.

See the Get Started section about how to set up your project to use the Sircl library.