Latest web development tutorials

jQuery #id selector

jQuery selector jQuery selector

Examples

Select the id "intro" element:

$("#intro")

try it"

Definition and Usage

#id selector to select the element with the specified id.

id id attribute references HTML elements.

Note: id attribute must be unique within a document.

Note: Do not use the id attribute numbers beginning!It may be a problem in some browsers.


grammar

$("#id")

参数 描述
id 必需。规定要选取的元素的 id。


jQuery selector jQuery selector