Using the Map function to get the text value from elements