{"action":"opened","issue":{"url":"https://api.github.com/repos/eternicode/bootstrap-datepicker/issues/1310","labels_url":"https://api.github.com/repos/eternicode/bootstrap-datepicker/issues/1310/labels{/name}","comments_url":"https://api.github.com/repos/eternicode/bootstrap-datepicker/issues/1310/comments","events_url":"https://api.github.com/repos/eternicode/bootstrap-datepicker/issues/1310/events","html_url":"https://github.com/eternicode/bootstrap-datepicker/issues/1310","id":62080990,"number":1310,"title":"adding datepicker to dynamically added elements of dom","user":{"login":"masterdany88","id":1161910,"avatar_url":"https://avatars.githubusercontent.com/u/1161910?v=3","gravatar_id":"","url":"https://api.github.com/users/masterdany88","html_url":"https://github.com/masterdany88","followers_url":"https://api.github.com/users/masterdany88/followers","following_url":"https://api.github.com/users/masterdany88/following{/other_user}","gists_url":"https://api.github.com/users/masterdany88/gists{/gist_id}","starred_url":"https://api.github.com/users/masterdany88/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/masterdany88/subscriptions","organizations_url":"https://api.github.com/users/masterdany88/orgs","repos_url":"https://api.github.com/users/masterdany88/repos","events_url":"https://api.github.com/users/masterdany88/events{/privacy}","received_events_url":"https://api.github.com/users/masterdany88/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-16T13:23:40Z","updated_at":"2015-03-16T13:23:40Z","closed_at":null,"body":"Hey. I use datepicker that way:\r\n<script>\r\n\t$(\".datepicker\").datepicker({\r\n\t    format: \"yyyy-mm-dd\",\r\n\t    startView: 1,\r\n\t    todayBtn: \"linked\",\r\n\t    todayHighlight: true,\r\n\t    language: \"pl\",\r\n\t    multidate: false,\r\n\t    calendarWeeks: true,\r\n\t    autoclose: true\r\n\t})\t\r\n</script>\r\n\r\nAnd I am adding new element to html dom, but for new input there is no datepicker.\r\nSo I've added some jquery for that:\r\n<script>\r\n\t$(\"body\").on('click', '.datepicker', function() {\r\n\t\t$(this).css(\"border-color\",\"red\");\r\n\t\t$(this).datepicker({\r\n\t\t    format: \"yyyy-mm-dd\",\r\n\t\t    startView: 1,\r\n\t\t    todayBtn: \"linked\",\r\n\t\t    todayHighlight: true,\r\n\t\t    language: \"pl\",\r\n\t\t    multidate: false,\r\n\t\t    calendarWeeks: true,\r\n\t\t    autoclose: true\r\n\t\t});\r\n\t\t\t\r\n\t});\t\r\n</script>\r\nBut It dosnt work great. I have to click many times on it to make it work, and some times datepicker shows up two calendars. Can You help me? Point it in documentation."}}