<!DOCTYPE html>type='text/javascript'src='http://code.jquery.com/jquery-2.1.0.js'type='text/javascript'$(window).load(function(){$("a").click(function(){event.preventDefault();console.log($(this).text());});});href="#1"link 1href="#2"link 2href="#3"link 3Check the console for output.