If you use a span, you can simply attach the picker to the span, and it should work as expected. To get the selected date, listen to the changeDate event on the span.
<span class="btn btn-default">Open picker</span>
$('span').datepicker().on('changeDate', function(e){ alert(e.format()) })
Using a div will result in an inline picker; if you take this approach, you can listen to the changeDate event in the same way as above.
On 04/03/2014 08:29 AM, Naresh Pilla wrote:
> HI All,
>
> I have a requirement that I need to display bootstrap datepicker when clicked on a span ot a div element.
> I don't have input box only span or div element, also I need to get the selected date.
>
> Please suggest me how to achieve this.
>
> Thanks,
> Naresh.
>
> --
> You received this message because you are subscribed to the Google Groups "bootstrap-datepicker" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to bootstrap-datepicker+unsub...@googlegroups.com <mailto:bootstrap-datepicker+unsub...@googlegroups.com>.