I am not very proficient with JS and currently I have the links that have the onclick event
<p><a onclick="return dateSelected('2012-10-23', '2')" href="#">2012-10-23</a></p>
<script>
function dateSelected(date, id){
function1(date,truckid);
}
<script>
now I added this, but I have no idea how to trigger the event to click:
<div id="datepicker"></div>
<script>
$(function() {
$( "#datepicker" ).datepicker();
});
<script>