Alter js delete fuction