how to get label for attribute value in javascript