admin管理员组

文章数量:1278721

I am using onfocusout as an html attribute and some javascript code inside it. Nevertheless, the code works fine in Chrome and browsers powered by webkit engines but it doesn't work in Firefox, I haven't tested other browsers yet.

Is there any alternative for 'onfocusout' attribute which is supported at least by firefox and chrome?

I am using onfocusout as an html attribute and some javascript code inside it. Nevertheless, the code works fine in Chrome and browsers powered by webkit engines but it doesn't work in Firefox, I haven't tested other browsers yet.

Is there any alternative for 'onfocusout' attribute which is supported at least by firefox and chrome?

Share Improve this question edited Dec 31, 2011 at 6:34 animuson 54.8k28 gold badges142 silver badges150 bronze badges asked Dec 31, 2011 at 6:28 NahiyanNahiyan 5325 silver badges21 bronze badges 2
  • Can you use onblur instead? – jfriend00 Commented Dec 31, 2011 at 6:32
  • 1 It may be worth adding more information to make your question more specific. This will help others to provide more insightful feedback. For example, add more detail about what you are trying to focus out, and provide code snippets. – Brombomb Commented Dec 31, 2011 at 6:38
Add a ment  | 

3 Answers 3

Reset to default 6

Can you use onblur?

Not sure what elements you are targeting but blur may work for you.

If that doesn't work for you then you may want to include a framework like jQuery which will help you with such cross browser issues.

http://api.jquery./focusout/

I know this question is from 2011, just want to let everyone know that FireFox support for this attribute is now available since March 6th, 2017: https://caniuse./#search=focusout

本文标签: javascriptFirefox doesn39t support onfocusoutStack Overflow