Functional delete button with JS