What would the JS code be for the following approach:

I have a link and when someone clicks on it an yes/no alertbox pops up. If the user clicks "no", the alertbox disappears and if he clicked "yes" the alertbox disappears and the user is redirected to the page *under* the link.

Thanks in advance.

PS: some nice-to-transform function would be nice.