You can simply use this.title inside the function
$('a').click(function() {
var myTitle = $(this).attr ( "title" ); // from jQuery object
//var myTitle = this.title; //javascript object
alert(myTitle);
});
Note
Use another variable name instead of 'alert'. Alert is a javascript function and don't use it as a variable name