0

I can make a jQuery datepicker work if the textfield is created when the website is loaded but if I make it appear with a .replaceWith() function, it wont work.

Here is my code when it just appears when the website is loaded: http://jsfiddle.net/ZnKMX/3/

And here is the code where I create a textfield using replaceWith: http://jsfiddle.net/ZnKMX/4/

j08691
  • 204,283
  • 31
  • 260
  • 272
Oskar Persson
  • 6,605
  • 15
  • 63
  • 124

1 Answers1

2

You need to do $( "#datepicker" ).datepicker(); after the element is created
FIDDLE

orhanhenrik
  • 1,407
  • 8
  • 11