Show Current Date onclick using jquery datepicker

I am using the datepicker ui for jQuery. The calendar is loading fine. Now I want to fire an event showing the current date when I select a day. I am trying to use this but not having any luck. The function looks like this: $(document).ready(AllPageLoads); function AllPageLoads() { $('#datepicker').datepicker(); $('table.games tbody tr.top').each(function (index) { if (index % 2 == 0) { $(this).addClass("even"); } else { $(this).addClass("odd"); } }); $('table.games tbody tr.bottom').each(function (index) { if (index % 2 == 0) { $(this).addClass("even"); } else { $(this).addClass("odd"); } }); } function EpicFail(response, status, error) { alert(response + " / " + status + " / " + error); } $('.selector').datepicker("option", "onSelect", function (dateText, inst) { alert(dateText); }); html:

Current Data

All Times Pacific/p>

Date Data Col1 Col2 Data1 Data2 Data3
6/9/2011 901 Team1 Payer1 info1 OFF OFF
4:05 PM 902 Team2 Palyer2 info2 OFF OFF

The code is fine and works in my tests. Are you sure your are using jquery 1.8+?

以上就是Show Current Date onclick using jquery datepicker的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » jQuery 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏