To select elements by ID value the #
syntax can be used. For example, #product
would select any element that has product
in its ID attribute like <div id="product"></div>
element:
An important note here ID selector matches any element that contains the value in the ID list (separated by spaces). To match elements that has an exact ID value the =
predicate can be used instead: