After some research, it seems that this is an issue with Mac OS (both desktop and mobile).
I made a small example to demonstrate, that focus events are not received for buttons ! (it works in Opera, Chrome, Firefox (on Windows, but not Safari on Mac OS X): http://jsfiddle.net/DMINATOR/7EtJD/
<div id="foo" data-role="page">
<div data-role="header">
<h1>Page Title</h1>
</div><!-- /header -->
<div data-role="content">
<p>Click here:</p>
<input type="button" data-custom-selector-attribute="true" name="btnTest" class="my-custom-selector-class" id="btnTest" value="Test" />
<p id="focus-attribute-result"></p>
<p id="focus-class-result"></p>
<p id="click-attribute-result"></p>
<p id="click-class-result"></p>
</div><!-- /content -->
$(document).on('focus', "input[data-custom-selector-attribute='true']", function (e) {
$("#focus-attribute-result").text("Focus - Got attribute selector!");
});
$(document).on('focus', ".my-custom-selector-class", function (e) {
$("#focus-class-result").text("Focus - Got class selector!");
});
$(document).on('click', "input[data-custom-selector-attribute='true']", function (e) {
$("#click-attribute-result").text("Click - Got attribute selector!");
});
$(document).on('click', ".my-custom-selector-class", function (e) {
$("#click-class-result").text("Click - Got class selector!");
});
There was a bug report created for jQuery, but it was closed, since it is not an issue with jQuery itself: http://bugs.jquery.com/ticket/7768
Right now it is waiting on Web Kit developers (Apple) https://bugs.webkit.org/show_bug.cgi?id=22261
It's been 4.5 years since this bug was first reported. Presumably the fix is simple (I looked at the patch) but it seems Apple folks (Darian, Alexey, etc.) can't agree to it and the debate is still going on.This makes webkit different from everything else on Windows.
I don't care about Safari on Mac or Windows but sadly this affects Chrome on Windows, which I do care about. See comment #20 from Daniel. I strongly urge the Apple folks to be a little open minded about this. It DOES affect end users.
This is actually fixed in Chrome now (https://code.google.com/p/chromium/issues/detail?id=89708), but not yet in Safari.