W3Schools.com

jQuery # Selector

jQuery Selectors jQuery Selectors

Example

Select the element with the id "choose":

$("#choose")

Try it yourself »

Definition and Usage

The # selector selects an element with a unique id.

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

The same id should never be used more than once in a document.

Syntax

$("#id")

Parameter Description
id Required. Specifies the id of the element to select.
The id selector uses the id attribute of the HTML element


Tips and Notes

Note: Do not start an ID name with a number. It may cause problems in some browsers.


jQuery Selectors jQuery Selectors


WEB HOSTING
Best Web Hosting
PHP MySQL Hosting
Best Hosting Coupons
UK Reseller Hosting
Cloud Hosting
Top Web Hosting
$3.98 Unlimited Hosting
Premium Website Design
WEB BUILDING
XML Editor - Free Trial!
FREE Website BUILDER
Best Website Templates Top CSS Templates
CREATE HTML Websites
EASY WEBSITE BUILDER
W3SCHOOLS EXAMS
Get Certified in:
HTML, CSS, JavaScript, XML, PHP, and ASP
W3SCHOOLS BOOKS
New Books:
HTML, CSS
JavaScript, and Ajax
STATISTICS
Browser Statistics
Browser OS
Browser Display
SHARE THIS PAGE