Wrap onclick in a closure