Pledge for a Healthy Internet
Mozilla exists to build the Internet as a public resource accessible to all because we believe open and free is better than closed and controlled. The HTMLElement.focus method sets focus on the specified element, if it can be focused. The focused element is the element which will receive keyboard and similar events by default. In recent years Mozilla has also focused on maximizing browsing area by simplifying toolbar controls to just a Firefox button (which contains settings and options) and back/forward buttons. The URL box features direct Google searching as well as an auto predict/history feature called Awesome Bar. The Mozilla Manifesto and Addendum represent Mozilla’s commitment to advancing these aspirations. We aim to work together with people and organizations everywhere who share these goals to make the internet an even better place for everyone.
The open, global internet is the most powerful communication and collaboration resource we have ever seen. It embodies some of our deepest hopes for human progress. It enables new opportunities for learning, building a sense of shared humanity, and solving the pressing problems facing people everywhere.
Mozilla is a global non-profit dedicated to putting you in control of your online experience and shaping the future of the web for the public good. Visit us at foundation.mozilla.org. Most content available under a Creative Commons license.
Mozilla Focus Browser
Over the last decade we have seen this promise fulfilled in many ways. We have also seen the power of the internet used to magnify divisiveness, incite violence, promote hatred, and intentionally manipulate fact and reality. We have learned that we should more explicitly set out our aspirations for the human experience of the internet. We do so now.
- We are committed to an internet that includes all the peoples of the earth — where a person’s demographic characteristics do not determine their online access, opportunities, or quality of experience.
- We are committed to an internet that promotes civil discourse, human dignity, and individual expression.
- We are committed to an internet that elevates critical thinking, reasoned argument, shared knowledge, and verifiable facts.
- We are committed to an internet that catalyzes collaboration among diverse communities working together for the common good.
![Mozilla Focus Mozilla Focus](/uploads/1/1/4/0/114001113/709665158.png)
Our 10 Principles
Learn more
Principle 2 The internet is a global public resource that must remain open and accessible.
Learn more
Learn more
Principle 4 Individuals’ security and privacy on the internet are fundamental and must not be treated as optional.
Learn more
Learn more
Principle 6 The effectiveness of the internet as a public resource depends upon interoperability (protocols, data formats, content), innovation and decentralized participation worldwide.
Learn more
Learn more
Principle 8 Transparent community-based processes promote participation, accountability and trust.
Learn more
Learn more
Principle 10 Magnifying the public benefit aspects of the internet is an important goal, worthy of time, attention and commitment.
Learn more
The
onfocus
property of the GlobalEventHandlers
mixin is an EventHandler
that processes focus
events on the given element.Cvt transmission. The
focus
event is raised when the user sets focus on an element.For
onfocus
to fire on non-input elements, they must be given the tabindex
attribute (see Building keyboard accessibility back in for more details).Note: The opposite of
onfocus
is onblur
.Syntax
Value
Mozilla Focus For Mac
functionRef
is a function name or a function expression. The function receives a FocusEvent
object as its sole argument.Firefox Focus Browser
Example
This example uses
onblur
and onfocus
to change the text within an <input>
element.HTML
JavaScript
Result
Try clicking in and out of the form field, and watch its contents change accordingly.
Specifications
Specification | Status | Comment |
---|---|---|
HTML Living Standard The definition of 'onfocus' in that specification. | Living Standard |
Browser compatibility
BCD tables only load in the browser
In contrast to IE, in which almost all kinds of elements receive the
focus
event, almost all kinds of elements on Gecko browsers do NOT work with this event.See also
focus
event- Related event handler:
GlobalEventHandlers.onblur