Skip to content

Instantly share code, notes, and snippets.

Created August 23, 2010 08:38

Revisions

  1. @invalid-email-address Anonymous created this gist Aug 23, 2010.
    12 changes: 12 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    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();
    }
    });
    });
    }