try this..
var selecteddate= $( "#datepicker" ).datepicker( "getDate" );
alert(selecteddate);
here is the documentation
updated
use onselect
, if you need it on click.
$( "#datepicker" ).datepicker({
onSelect: function(date) {
alert(date);
//do your processing here
}
});