The Onclick event on the jQuery dialog box does not work with IOS

advertisements

I am using IOS device and developing application. i face one issue with onclick event in dialog box. I have one text box in dialog and need to call one function using onclick event. but it is not working in IOS(Ipad/IPhone). can someone check this and suggest me. below is the simple code which is not working in IOS. I have try ontouchstart event, that is working fine but what wrong with onclick ?

-code from Dialog box

<input type="text" onclick="hello();">
<script>
 function hello()
 {
    alert(2222);
 }
</script>


Ther is an issue with IOS not registering click/touch events bound to elements added after DOM LOADS.

IN you code to the below changes and it should work.

<input type="text" onclick="hello();" style="cursor:pointer">

The above line will fix your code.

Also you can refer the below link and know in depth as to why the IOS does not register click/touch events.

http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html

Hope this gives you a better understanding. Appreciate your comments.