Open HTML5 date picker on icon click

后端 未结 6 1970
孤街浪徒
孤街浪徒 2020-12-03 13:27

I have an HTML5 date picker.
It is opened when I click on the date picker text box.

Todo :

  • I have to change the event to an icon,
6条回答
  •  独厮守ぢ
    2020-12-03 14:09

    I'm answering this, hoping that someone new would find it helpful: My html was like this:

    '>
    $(function() { $(document).on('click','.datedisplay',function() { $(this).siblings('[type="date"]').removeClass('hidden').focus().click(); $(this).remove(); }); });

    I've tested it on chrome simulator as well as on android devices and it works perfectly fine. Needs testing on iOS devices though.

提交回复
热议问题