There are many times when you want the user to confirm an option he/she tries to perform and in this example I will show how you can use a simple Javascript to display a confirm box when a user clicks on a link.
The XHTML
<a href="test.html">Delete user</a>
Now add the onclick attribute and write the Javascript
<a href="test.html" onclick="return confirm('Are you sure?');">
Delete user
</a>
If the user clicks on the link he/she must confirm the action. If the user clicks on the OK button in the confirm box the link will be followed, if not the link will not be followed.
/Simon Kjellberg