jQuery # Selector

Example

Select the element with id="choose":

$("#choose")

Try It Yourself

Definition and Usage

# selects elements with a unique specified id.

ID references the id attribute of HTML elements.

The same id value can only be used once in the document.

Syntax

$("#ID)
Parameter Description
ID

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

The ID selector uses the id attribute of HTML elements.

Tips and Comments

Note:Do not use ID names starting with numbers! It may cause problems in some browsers.