This is my click event. Why does it become new every time I add an element?
ringa_lee2017-05-18 10:56:21
Because you initialize arr to new data every time var arr = [];
You should initialize arr on the click method
phpcn_u15822017-05-18 10:56:21
Put var attr= []; outside the function and promote it to a global variable, and you should be fine.