replace click handler with action handler, which generalizes clicks