or just went out . jQuery selector based on id elements, classes, types, attributes, attribute values, and so on "Find" (or select) HTML elements. It is based on existing CSS selectors , in addition, it also has some custom selectors. All jQuery selectors start with a dollar sign For the jQuery selector, can I use the ul class, instead of the two list ids??but I wonder why does the jQuery website give the example with both list ids as selector and not just the class name?? Could I run into compatibility issues if I use the class as selector? ID Ends With selector id-vs-id-ends-with-vs-id-contains-vs-class- selectors Element E whose attribute attr ends in val. jQuery Id Selector Demo. That may result in bugs. Its better to have separate behavioral and presentation classes, use presentation classes in CSS, and behavioral classes for selecting elements in jQuery. id vs class selection benchmark 2 answers. I have one (and only one) div in my markup like thisIn terms of performance, which is the best jQuery selector for this single div ID Ends With selector id-vs-id-ends-with-vs-id-contains-vs-class- selectors Example. Jeff Friesen continues his exploration of selectors by focusing on jQuerys form and attribute selector of jQuerys attribute selectors that See the jQuery attribute selectors page to learn about the flexibility of jQuery selection. Keeping a bookmark on this page will prevent you from ever having to write code like your second example again.