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

jQuery :target selector

jQuery :target selector

jQuery selector jQuery selector

Definition and Usage

The :target selector picks the target element indicated by the document URI's fragment identifier.

**Tip:** If the document's URI contains a fragment identifier or hash, the :target selector will match the element whose ID matches the identifier. For example, given the URI http://example.com/#foo, $("p:target") will select the element.

.


Syntax

$

( ":target" )


jQuery selector jQuery selector