When the user puts their focus inside (tabbing or clicking into the field) the input field (with id equal to 'nickname'), we 'bold' the text. When they 'blur' (input field loses focus) we change the font weight back to 'normal'.
A very powerful concept within protoscript is the ability to manage behavior across a set of elements and their related elements.
Here we have a form with 5 input fields, each with their own label.
We select the blur/focus events for the input fields ('.employee-form input' means select all elements of type 'input' that are inside an element with class name 'employee-form).
We then target the corresponding labels ('employee-form label') for style changes (SetStyle).
Here we have a variation on the previous example.
In the outer SetStyles we target the labels (changing their fontWeight and text color with blur/focus). All behaviors implement a callback that is fired when the behavior executes. Notice we use SetStyle in the onSetStyle callback.
Inside these callbacks we select a new target-- the input fields changing their fontWeight.
The result is when the user tabs into a field both the label and the input field are bolded and the label is also set to blue. When the user tabs out of an input field, the label and the input field are set back to a normal fontWeight.
For a full description of this behavior see the Blur Documentation Page.