Problems with click events

I’m sorry to bother you again, I’m ready for a custom object click event, desired effect is click the selected module changes the background color, this custom has been achieved but this custom has affected the attachment click delete selected events, I have to double click on the attachment to delete the attachment, could you tell me how to modify this to both does not conflict, are looking forward to your reply, thank you.