How to auto change the label color

Hi My form have Field Type: Text. Want to change label color by some condition  show user this text are required. I use java script  document.getElementById setting style ,but  need to setting "id" . I don't know how to setting "id" in aras object ? Have another better way to do required field?