A ‘click reaction’ is used to synthesise a fluorescent self-assembled monolayer, which can be used to detect Hg2+ in both water and organic solutions. The resulting fluorescence sensor exhibits a rapid response and high sensitivity to Hg2+ due to the synergy effect between the nitrogens of a triazole group and a rhodamine moiety. The sensing properties are stable over a wide pH range in aqueous solutions.