I would advise to use the scripts:
The problem could by somewhere else. For example, the selector ".txt" should be in quotation marks and the class with such names should exist in styles you are using. Do you have this class? There could be something else — your sample is incomplete.
And pay attention for my comment to the question, if you want to avoid frustration and lost time.—SA