a more general approach regarding the onclick