add and remove html elements dynamically with javascript