Add click attribute for hash update when DOM loaded instead of writing explicity in html