base code, add click event