Display confirmation popup with JavaScript upon clicking on a link
问题 How do I make one of those hyperlinks where when you click it, it will display a popup asking "are you sure?" <INPUT TYPE="Button" NAME="confirm" VALUE="???" onClick="message()"> I already have a message() function working. I just need to know what the input type for a hyperlink would be. 回答1: <a href="http://somewhere_else" onclick="return confirm()"> When the user clicks the link, the confirm function will be called. If the confirm function returns false , the link traversal is cancelled,