Button Click Not Working Javascript Foreach