onclick event is not working on ipad and tablet

≯℡__Kan透↙ 提交于 2019-12-01 06:24:31

You can use tap, swipe, taphold etc events for the tablets,touch you can do this like

$('htmlelement').bind('click', ClickFunction ).bind('tap', ClickFunction );

Here are the list of jquery mobile events events

Also try to use the jquerymobile

Hitesh

You must have to bind the 'click' or 'tap' event for associated HTML control. You can bind like this

$('elementid').bind('click',function() {   alert('Click event triggered'); });

OR

$('elementid').bind('tap',function() {  alert('Tap event triggered'); });

You need to use touchstart i get you a small example,

$('elementid').on('click touchstart', function() {
      console.log('1');
});

The touchstart event is fired when a touch point is placed on the touch surface.

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