completed .js with clear data and display data