Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

jQuery :focus selector

jQuery :focus selector

jQuery selector jQuery selector

Example

Select the element that currently has focus:

$(":focus")

Try it »


Definition and Usage

The :focus selector picks the element that currently has focus.

**Tip:** This selector is often used together with a tag name or another selector; if used on its own, the selection is equivalent to ("*:focus").


Syntax

$(":focus")


jQuery selector jQuery selector