Hello to all,
I have written following HTML code:
I want to produce HTML page with a single link. If I click on that link, it will ask for confirmation and If I press Cancel the link will not activate. But using above code it goes to the other link even if I press cancel. Can anyone tell me why does onclick event not cancel href navigation?Code:<html> <head> <title></title> </head> <body> <a onclick="return confirm('Are you sure?');" href="http://www.google.com">BBC</a> </body> </html>
Please help me.
Bookmarks