$("#datepicker") searches the DOM for this id. So nothing is coming-
back despite having a non-DOM element with this ID.
This should work: Reference it explicitly.
$.('<div id="datepicker" />').datePicker(...).appendTo
("#SomeContainer");
One caveat: I know the datepicker adds other things to the DOM, like a
textbox placeholder for example. I don't know if datepicker assumes
the target element is itself in the DOM. Let us know how this turns
out <s>.
**--** Steve
On Oct 30, 3:54 am, shawn <[email protected]> wrote:
> Hi there,
>
> I am trying to add a datepicker to an element that is not yet attached
> to the DOM. is this possible?
>
> The #datepicker is a text box that is not yet added to the DOM...
>
> $("#datepicker").datepicker({
> width: 80,
> buttonImage: '/images/Web/calendar.gif'
> });
>
> How can I accomplish this?
--
You received this message because you are subscribed to the Google Groups
"jQuery UI" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/jquery-ui?hl=en.