Created
December 2, 2011 12:41
-
-
Save kageroh/1423105 to your computer and use it in GitHub Desktop.
Mac OS X で input[type="checkbox"] な要素をクリックしてもフォーカスされないのがうざい。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name focus.js | |
// @namespace http://twitter.com/amasawa | |
// @version 0.1 | |
// @include http://sp.pf.mbga.jp/* | |
// @include https://sp.pf.mbga.jp/* | |
// ==/UserScript== | |
(function(global){ | |
var inputs = document.querySelectorAll('input[type="checkbox"]'); | |
for (var i = inputs.length; i--;){ | |
inputs[i].addEventListener('click', function(event) { | |
event.target.focus(); | |
}); | |
} | |
}(this)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment