datetime picker - can not be initiated on "image.click" event ?

datetime picker - can not be initiated on "image.click" event ?

Hello..
I just downloaded UI and it workes. When I click to a textbox, calendar appears. I have to click twice, but it works.
Now I want to have an icon next to the textbox and initiate calendar when the icon is clicked. This seems to be impossible. Can anyone help please? I do it like this:

  1. <input type="text" id="datetimetextbox"/>
  2. <img src="dateIcon.png" alt="btn" id="mybutton"/>

    <script>
    $("#mybutton").click(function(){
          $( "#datetimetextbox" ).datetimepicker();
      })
    </script>