How do I open the jquery datepicker by clicking on a hyperlink?

ぃ、小莉子 提交于 2019-12-11 06:49:38

问题


I have a link <a href="#">Choose Date</a> that I want to click and pop open the datepicker. Is there any way to do this?


回答1:


Yes, by calling it on a div and then showing/hiding that div. Use altField to write the date to a hidden input element.




回答2:


you can do this right. you can have a click handler for a href and handle the code inside that

<a href="#" class="sample">Choose Date</a>

$('.sample').click(function() {
   // write your logic here 
   return false;
});


来源:https://stackoverflow.com/questions/4419308/how-do-i-open-the-jquery-datepicker-by-clicking-on-a-hyperlink

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!