2019.2

Table Of Contents
"Personalizing content" on page786 and "Writing your own scripts" on page853). Using
selectors for scripting can increase the speed with which a template and data are merged; see
"Use an ID as selector" on page868.
Standard CSS selectors
l Selectors are made up of one or more of the following components:
l
An HTML element. Type the HTML tag without the angle brackets (e.g. p) to select all
elements of that type (pselects all paragraphs).
l
A class. Type the class name, preceded by a dot, e.g.: .green, to select HTML elements
with that class.
l
An ID. Type the ID, preceded by #, e.g.: #intro, to select an HTML element with that ID.
l
An attribute of an HTML element. Type the attribute and, optionally, its value, between
square brackets, e.g.: [target], to select HTML elements with a matching attribute.
l
A pseudo-class. For example, tr:nth-child(even) selects all even table rows.
These components can be combined in different ways. For example, p div selects all
paragraphs inside <div> elements, while p, div selects all paragraphs and all <div> elements.
A complete list of selectors and ways to combine them, and a tool that demonstrates their use
can be found at W3Schools: http://www.w3schools.com/cssref/css_selectors.asp.
A video about CSS and Script Selectors, can be found here: Connect with Evie 6 - CSS and
Script Selectors.
Connect classes and attributes
Connect itself sometimes adds a specific class or attribute to elements in a template. Capture
OnTheGo widgets, for example, have a role attribute that allows the COTG library to dictate
their behaviour. Connect classes and attributes can be used in selectors, as will be explained
and demonstrated below.
Connect-specific classes usually are invisible in the Designer. By opening the currently
selected section in your default web browser (click the Preview HTML toolbar button) and using
the browser's code or source inspector you can see most of the dynamically added classes.
Page 879