This event is triggered when an element receives focus in the UI. When it has focus, it can accept keyboard events. The opposite of onfocus is onblur.