Skip to content

Instantly share code, notes, and snippets.

@mrmartineau
Forked from anonymous/gist:545079
Created June 16, 2012 09:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mrmartineau/2940821 to your computer and use it in GitHub Desktop.
Save mrmartineau/2940821 to your computer and use it in GitHub Desktop.
if (navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/iPad/i)) {
$(document).ready(function () {
$('label[for]').click(function () {
var el = $(this).attr('for');
if ($('#' + el + '[type=radio], #' + el + '[type=checkbox]').attr('selected', !$('#' + el).attr('selected'))) {
return;
} else {
$('#' + el)[0].focus();
}
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment