How to get value in javaScript method showPopulate()