function onclick can’t called when i click the field, not when I click on the calendar. can anyone help me?
Probably you meant the case of initialization calendar when it is attached to the html input.
If the calendar is attached to an input, it sets onclick event handler and redefines the handler that has been set before.
You may set event listener instead:
var inp = document.getElementById(‘calendarInput’);
inp.addEventListener(“click”, yourFunction, false);
else if (inp.attachEvent)