Delete js function