How to get Message Box before file download?

I’m really rusty on my JavaScript and have a friend wanting me to help them out last minute.

I’m wanting a message box to appear when a user clicks on a link that pops up a message. Once they click "OK’ on the message box, a file download box pops up letting them open/save the file.

Basically a person clicks on a link for a class. A message box pops up saying “Please print and bring the following papers to class.” When they click “OK”, the *.pdf file pops up ready to be downloaded.

Can anyone point me in the right direction?

Thanks.

Here is what I have so far. This somewhat worked for a *.pdf because the browser would open the file. I’ve been told they want to use a *.docx file, which doesn’t work. Any advice on how I can modify this to work? I’m wanting the “Open/Save” File download box to appear after the message.

<html><head><title>Course Content</title>
<script type=“text/javascript”>
function linkRef(yurl ){
var linkref = yurl;
if(confirm(“Please print the following pages and bring to class.”)){
window.location.href=linkref;
}
}
</script>
</head>
<body>
<a href=“#” onClick=“linkRef(‘http://www.whatever.com/test.docx’ )”>Link to Document</a>
</body>
</html>