Hello, Thanks for your answer, but :
- First solution does not work in my case since new INPUT can be added dynamically to the document. - Second solution does not work when i try. In fact what i need would be something like that (I know the following code is not valid) : Element.addMethods('input', { initialize: function(element) { // do some initialization for any inputs ... }, onblur: function(element) { // do something for any inputs on blur ... }, onfocus: function(element) { // do something for any inputs on focus... }, // etc }); On Jul 9, 3:55 pm, jdalton <[EMAIL PROTECTED]> wrote: > $$('input,textarea').invoke('observe', 'focus', function(event) { > ... > > }); > > or event deligation: > $(document.body).observe('focus', function(event){ > var element = event.element(); > if ( !/^(input|textarea)$/.test(element.tagName) ) return; > > //code here > > }); > > - JDD --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---