how to get element id dynamically in javascript