Not use "Id" and "Class" selectors.
I have been working on a project which has a lot of jQuery code. Multiple developers work on the project and everyone who gets a chance to implement something new using jQuery, they follow the easiest approach, they allocate an "Id" to the DOM element, using the Id selector they select the element in jQuery and attach a callback to it to achieve whatever they are looking to implement.
This has lead to a lot "Ids" and "classes" in the project, the code has become hard to understand and looks bad. I am trying to find a way to somehow replace the "IDs" and "classes". Can someone suggest me a good way to do it?
One thing I have in mind is to utilise the event object which has a property known as target, I think it could be utilised to pass the reference of the DOM element rather than using the ID.