Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
//
// 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