Home > HTML5 > HTML5 textbox tap issue in IPhone

HTML5 textbox tap issue in IPhone

Sometimes the textbox not get focus on tap and the app gets stuck for some time.

In order to resolve this issue, include this code in document.ready

document.addEventListener("touchend", function (e) {
if (e.target.nodeName.toString().toUpperCase() == 'INPUT' || e.target.nodeName.toString().toUpperCase() == 'TEXTAREA') {
e.preventDefault();
e.target.focus();
});

Happy coding 🙂

Advertisements
Categories: HTML5
  1. :)
    July 7, 2014 at 8:42 am

    🙂

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: