Sub MainDiv_Click (Params As Map)
'find the target element
Dim target As String = Params.Get("target")
If target.StartsWith("btn") Then
plog.SetHtml(WebUtils.ReplaceMap("Button <i>$TARGET$</i> was clicked", CreateMap("TARGET": target)))
Dim btn As JQueryElement = ws.GetElementById(target)
'get the current value from the map.
Dim counter As Int = buttonsText.Get(target)
counter = counter + 1
btn.SetText(counter)
buttonsText.Put(target, counter)
btn.SetCSS("background-color", RandomCSSColor)
End If
End Sub