BigJobbies
BigJobbies

Reputation: 4343

jQuery - and operators

I have the following code

jQuery(".opsection input").live('change', function(){

What i want to also do is add an 'or' operator so that it runs on a 'change' function also when someone 'clicks' a text field

Any help would be grand.

Upvotes: 0

Views: 134

Answers (2)

jondavidjohn
jondavidjohn

Reputation: 62392

you do it like this

jQuery(".opsection input").live('change click', function(){

This will run the function on either a change or click event.

from the jquery docs

Upvotes: 4

Chandu
Chandu

Reputation: 82913

Try this:

jQuery(".opsection input").live('change click', function(){

Check this link for more information: http://api.jquery.com/live/

Upvotes: 1

Related Questions