Text underline hover effect

Hi,
Thank you very much for the reply. I am trying to add this effect to more then one text in one page but I am not sure how can I do that in one function code. I have #text20 which is working fine now but I have #text24 I also need the same effect.