Disable autocomplete for keyup on jQuery

There’s an event I cannot handle on jQuery: the Firefox autocomplete on textarea.

If you have to use the keyup event for a string match on textarea content, you have to exclude autocompletion, that is out of keyup logic.

To do this, simply add:

$(‘#myelement’).attr(‘autocomplete’, ‘off’);

to your jQuery. Autocomplete will be disabled and the unhandled event will not fire.

See also:

Advertisements

One thought on “Disable autocomplete for keyup on jQuery

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s