Skip to content

Instantly share code, notes, and snippets.

@cjmarkham
Created February 28, 2014 14:55
Show Gist options
  • Select an option

  • Save cjmarkham/9272500 to your computer and use it in GitHub Desktop.

Select an option

Save cjmarkham/9272500 to your computer and use it in GitHub Desktop.
<a href="" target="_blank" id="foo">Click Me</a>
<script>
document.addEventListener('DOMContentLoaded', function () {
document.getElementById('foo').addEventListener('click', function () {
window.location.href = 'http://google.com';
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment