You don't need complex code to follow this technique. Here are the most common ways to provide warning:
Have you ever clicked a link only to be jolted out of your current tab and into a brand-new window without warning? For many users, it’s a minor annoyance. But for users with visual impairments or cognitive disabilities, it can be completely disorienting. That’s where comes in. What is Technique G201? You don't need complex code to follow this technique
Users should always know what to expect when they interact with a link. You don't need complex code to follow this technique