"You are now leaving this website" URL click notification

I was wondering how I would be able to achieve a simple notification that the user is now leaving our Webflow website upon clicking a URL pointing outside our site.
I’ve seen other websites do popups. Yelp takes you to a new page entirely, then after a few seconds takes you to your intended destination.

This would be on hyperlinks the user would click on our site.

Any suggestions?

HI @Greg1 here is one suggestion how it can be done.

Stan, thank you so much for taking the time to show me this. I would be using this on CMS items in Webflow so I’d have to adjust accordingly but I see the basic logic behind this. I will look this over. I am a total novice so code is scary to me. But I liked how you explained everything.

I will let you know how it goes. Appreciate it.