Utilization of Javascript for dynamic HTML elements