Skip to content

Instantly share code, notes, and snippets.

@hammad13060-zz
hammad13060-zz / block-default-anchor-tag-behaviour.html
Last active May 23, 2018 19:41
Attach on click handlers to anchor tag and allow/block default bahaviour of tag.
<!DOCTYPE html>
<html>
<head>
<title>I am a test page.</title>
</head>
<body>
<a id="testId" href="https://google.com">Click Here</a>
</body>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="