Source Code:
Go to W3Schools.com
The preventDefault() method will prevent the link above from following the URL.
Result:
W3Schools.com
- Try it yourself