Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 2 Next »

The onfocus event activates when an element receives focus.  The JavaScript keyword this refers to the element that received focus.

Example:

The following would draw a red border around the element once it receives focus.

onfocus: this.style.border = "1px solid red";

  • No labels