Created
January 7, 2010 18:15
-
-
Save paulirish/271424 to your computer and use it in GitHub Desktop.
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
// | |
// Replicates .activate() from the Prototype JS library. | |
// http://www.prototypejs.org/api/form/element/activate | |
// | |
jQuery.fn.activate = function() { | |
if ('focus' in this) this.focus(); | |
if ('select' in this && (this.tagName != 'INPUT' || !(/^(?:button|reset|submit)$/i.test(this.type)))) { | |
this.select(); | |
return this; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment