Javascript if/else with onClick event ?