For example, in the initial state of Inactive, the only expectedevent is mouseover, so you can define a function to handle that situation, as shown in Listing 9.
Starting with StartElement as the next expectedevent, the method will concatenate all characters and return the resulting string before an EndElement is encountered.
An alert can be used to provide an actionable message based on a single or set of correlated events that have occurred or based on an expectedevent that has not occurred.