Skip to main content

Keywords

Keywords are reserved words in the syntax that have special meaning. Keywords are used to define the structure of the query and to specify the elements that should be selected. Keywords are not case sensitive.

Keywords may be used in string literals, but they are not treated as keywords in that context. For example, LINK is a keyword, but 'LINK' is a string literal that may be used in attribute selectors.

Priority

CSS Selectors are written in a specific order. For example, element selectors are written before attribute or pseudo selectors. Aside from combinators, you don't have to worry about maintaining this order in your Jelly SQL. The parser will automatically sort the selectors in the correct order.

Parser Order (Highest to Lowest)

  1. TAG || ELEMENT
  2. ID
  3. CLASS
  4. ATTRIBUTE || ATTR
note

Any not mentioned, will be sorted based on the defined order in your Jelly SQL query.

Combinators

CSS combinator selectors are evaluated from right to left. In Jelly SQL, the order is defined by the language itself.

Here's an example of a combinator in CSS:

SELECT * FROM DOM WHERE
TAG('p') CHILD OF TAG('div')

Statement Keywords

Statement keywords are used to define the structure of the query. They are used to specify the type of operation that should be performed on the elements.

KeywordIntroduced
SELECT1.0.0
FROM1.0.0
WHERE1.0.0
AS1.0.0

Element Keywords

Element keywords are used to specify the elements or attribute type that should be targeted by the query.

KeywordIntroduced
TAG1.0.0
ELEMENT1.0.0
ID1.0.0
CLASS1.0.0
ATTRIBUTE1.0.0
ATTR1.0.0
STYLE1.0.0

Pseudo Selector Keywords

Pseudo selector keywords are used to specify the type of element that should be selected based on its position or state.

KeywordTypeIntroduced
FIRSTStructural1.0.0
LASTStructural1.0.0
ODDStructural1.0.0
EVENStructural1.0.0
ONLYStructural1.0.0
EMPTYStructural1.0.0
ROOTStructural1.0.0
LINKLink1.0.0
VISITEDLink1.0.0
ACTIVEUser Action1.0.0
HOVERUser Action1.0.0
FOCUSUser Action1.0.0
ENABLEDUI Element1.0.0
DISABLEDUI Element1.0.0
CHECKEDUI Element1.0.0
FIRSTLINEMisc1.0.0
FIRSTLETTERMisc1.0.0
TARGETMisc1.0.0
BEFOREMisc1.0.0
AFTERMisc1.0.0