thank so much Ray. this is what I have found out.
I have posted a wrong problem. The problem is not with the html or php. the problem is with template. The code should go to the <head></head> and I am putting the code in a greyed <head></head> since I am using a page derived from a template. Only the editable region is not greyed.
Sorry. I don't have the answer yet. Help if possible.