Click on datepicker's date

Click on datepicker's date


Hi every body,
I'm in trouble with an inline datepicker. I want to get the date on
which i cliked to make an startdate for the week calendar's launch.
I've tried to implent onSelect, the main page head as :
$j("#datepicker").datepicker({
onSelect: function(dateText, inst) { alert('dateText')}
});
I've also tried to implent onClick the main page head as :
$j("#datepicker").click({
var day = $j(this).html())}
var month = $j(".ui-datepicker-month").html();
var year = $j(".ui-datepicker-year").html();
var startDate = new Date(year, month, day);
alert(startdate);
});
Nothing works.
Any help would be appreciated
Many tks