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

jQuery #id selector

jQuery #id selector

jQuery selector jQuery selector

Example

Select the element whose id is "intro":

$("#intro")

Try it »


Definition and Usage

The #id selector picks the element with the specified id.

The id refers to the id attribute of an HTML element.

**Note:** The id attribute must be unique within the document.

**Note:** Do not use an id attribute that starts with a digit! This may cause problems in some browsers.


Syntax

$("#

id

")

Parameters Description
id Required. Specifies the id of the element to be selected.

jQuery selector jQuery selector