Using onClick event to replace the location.hash event