Replace Onclick by func