Selector
Sf. Selector
A class to easily select DOM elements
and to group DOM selectors and DOM
manipulation functions
Sf encourages to make a moderate
use of CSS selectors to not bound
the programming / structure of a web
application to its design / style.
Specifically, CSS selectors using
tag and class names should be used only
when the transformation concerns the style
/ class of the element,
while in all other cases we should rely
on the id or some custom attribute.
In no cases we should identify an element
by its class or tag name when is not concerned
a modification of specifically its style,
because the class name and even the tag (and
their hierarchy) could change for purposes of design.
In short, CSS selectors, or native, or
through Sizzle (incorporated by JQuery) should be used by
the design department *on top* of the application,
while the core and programming department should
make a minimalist and careful use of them,
so that a "polyfill" for the querySelector()
function at this level should be not required
nor envisaged.