2

Possible Duplicate:
When onblur occurs, how can I find out which element focus went to?

I have a jquery function that allows me to do something when an element (here selectionChamp) loses focus:

$("#selectionChamp").blur(function() {      
    $("#detailChamp").attr('disabled', true, 'enabled', false);
    $("#supprChamp").attr('disabled', true, 'enabled', false);      
});

I would like to add a condition for the function to do something when you lose focus unless you click on an element with another id. (id="toto" for example !^^)

An idea?

Community
  • 1
  • 1
Clément Andraud
  • 9,103
  • 25
  • 80
  • 158
  • The #selectionChamp will limit the function to elements with an Id of selectionChamp, so you can't have an element with a different Id - did you mean to use a class instead? – BonyT Jul 13 '12 at 12:33
  • 1
    Related: http://stackoverflow.com/questions/121499/when-onblur-occurs-how-can-i-find-out-which-element-focus-went-to. – Frédéric Hamidi Jul 13 '12 at 12:34
  • @Frederic not only related, it is THE answer. – Christoph Jul 13 '12 at 12:37

0 Answers0